diff options
author | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2012-11-14 13:46:21 +0100 |
---|---|---|
committer | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2012-11-14 13:51:31 +0100 |
commit | c07fcb616e0db81472889488189dc2f440020ef6 (patch) | |
tree | 8c05d03ae7b2947c69d5acc3beb21e90b01f0d38 | |
parent | 29d6dd5bb33afc52067ba7e2351d6c3b85b75c16 (diff) | |
download | ecs2-c07fcb616e0db81472889488189dc2f440020ef6.tar.gz ecs2-c07fcb616e0db81472889488189dc2f440020ef6.zip |
Fixed returned Content-Type header.
Now you get get the correct Content-Type header after resource creation.
-rw-r--r-- | app/controllers/messages_controller.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 1885d2d..0c6a3a5 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -232,7 +232,7 @@ protected if stale?(:etag => @record, :last_modified => @record.updated_at.utc, :x_ecs_receiver_communities => x_ecs_receiver_communities, :x_ecs_sender => x_ecs_sender) - render :text => @body, :layout => false, :status => 200, :content_type => @record.content_type + render :text => @body, :layout => false, :status => 200, :content_type => Mime::Type.lookup(@record.content_type) end end @@ -241,9 +241,9 @@ protected location += request.headers["SCRIPT_NAME"] if request.headers.has_key?("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 + render :text => @body, :layout => false, :status => 201, :location => location, :content_type => Mime::Type.lookup_by_extension("json") else - render :text => "", :layout => false, :status => 201, :location => location + render :text => "", :layout => false, :status => 201, :location => location, :content_type => Mime::Type.lookup(@record.content_type) end end |