aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorHeiko Bernloehr <Heiko.Bernloehr@FreeIT.de>2012-11-14 13:46:21 +0100
committerHeiko Bernloehr <Heiko.Bernloehr@FreeIT.de>2012-11-14 13:51:31 +0100
commitc07fcb616e0db81472889488189dc2f440020ef6 (patch)
tree8c05d03ae7b2947c69d5acc3beb21e90b01f0d38 /app
parent29d6dd5bb33afc52067ba7e2351d6c3b85b75c16 (diff)
downloadecs2-c07fcb616e0db81472889488189dc2f440020ef6.tar.gz
ecs2-c07fcb616e0db81472889488189dc2f440020ef6.zip
Fixed returned Content-Type header.
Now you get get the correct Content-Type header after resource creation.
Diffstat (limited to 'app')
-rw-r--r--app/controllers/messages_controller.rb6
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