X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/b95e9d27599ee55b2fd61a444acc3264c7637265..8de8ef4f6b0174f68efca340b2e71df34fe2ae63:/app/controllers/node_controller.rb diff --git a/app/controllers/node_controller.rb b/app/controllers/node_controller.rb index 428d4b9c2..416d1794f 100644 --- a/app/controllers/node_controller.rb +++ b/app/controllers/node_controller.rb @@ -5,12 +5,18 @@ class NodeController < ApplicationController def create if request.put? - node = Node.from_xml(request.raw_post, true) + node = nil + begin + node = Node.from_xml(request.raw_post, true) + rescue + render :text => "XML didn't parse", :status => 400 # if we got here the doc didnt parse + return + end if node node.user_id = @user.id + node.visible = 1 if node.save_with_history - render :text => node.id else render :nothing => true, :status => 500