diff options
author | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2017-03-11 03:01:03 +0100 |
---|---|---|
committer | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2017-03-11 03:01:03 +0100 |
commit | 6b0fb87a34f26ae0234315f52201ddd9ca88d0b1 (patch) | |
tree | e2aa7073d2fe1507bd303ac42d7459ee35da0ef7 | |
parent | 72f18b0e31fc2b2efac4f475477b44a41e3264d3 (diff) | |
download | ecs-6b0fb87a34f26ae0234315f52201ddd9ca88d0b1.tar.gz ecs-6b0fb87a34f26ae0234315f52201ddd9ca88d0b1.zip |
Change key test on request.headers.
app.request.headers.has_key?("SCRIPT_NAME")
=> NoMethodError: undefined method `has_key?' for #<ActionDispatch::Http::Headers:0x000000050236e0>
-rw-r--r-- | app/controllers/messages_controller.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index fdf4d60..5600db9 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -243,8 +243,9 @@ protected def create_render location = request.protocol + request.host + # FIXME request.headers["SERVER_PORT"] is a string compared to integers. location += ":" + request.headers["SERVER_PORT"] unless [80,443].include? request.headers["SERVER_PORT"] - location += request.headers["SCRIPT_NAME"] if request.headers.has_key?("SCRIPT_NAME") + location += request.headers["SCRIPT_NAME"] if request.headers["SCRIPT_NAME"] location += request.path.gsub(/\/*$/,'') + "/" + @record.id.to_s if @app_namespace == 'sys' and @ressource_name == 'auths' render :text => @body, :layout => false, :status => 201, :location => location, :content_type => Mime::Type.lookup_by_extension("json") |