aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/request_controller.rb
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2012-06-20 10:59:54 +0100
committerSeb Bacon <seb.bacon@gmail.com>2012-06-20 10:59:54 +0100
commit7d0fea4b38c214a67b2fc4b56aa670e02a3cda61 (patch)
tree85e77cf7ba0656efbacf1497baff2ef96887bd3b /app/controllers/request_controller.rb
parent6ef57090e436e01bc5de801bc7acb6bfadb5c490 (diff)
parent6c4c822ef7a4491bf821326af779e5be9118c0a1 (diff)
Merge branch 'master' into develop
Diffstat (limited to 'app/controllers/request_controller.rb')
-rw-r--r--app/controllers/request_controller.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index bd2bfc974..2f5b4d643 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# app/controllers/request_controller.rb:
# Show information about one particular request.
#
@@ -47,7 +46,13 @@ class RequestController < ApplicationController
end
def show
- medium_cache
+ if !MySociety::Config.get('VARNISH_HOST').nil?
+ # If varnish is set up to accept PURGEs, then cache for a
+ # long time
+ long_cache
+ else
+ medium_cache
+ end
@locale = self.locale_from_params()
PublicBody.with_locale(@locale) do
@@ -663,7 +668,7 @@ class RequestController < ApplicationController
)
if !info_request.attention_requested
- info_request.set_described_state('attention_requested')
+ info_request.set_described_state('attention_requested', @user)
info_request.attention_requested = true # tells us if attention has ever been requested
info_request.save!
flash[:notice] = _("This request has been reported for administrator attention")
@@ -710,7 +715,7 @@ class RequestController < ApplicationController
# we don't use @attachment.content_type here, as we want same mime type when cached in cache_attachments above
response.content_type = AlaveteliFileTypes.filename_to_mimetype(params[:file_name].join("/")) || 'application/octet-stream'
- headers["Content-Disposition"] = "attachment; filename=#{params[:file_name]}"
+
render :text => @attachment.body
end