aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2010-11-02 18:28:45 +0000
committersimonbrandhof <simon.brandhof@gmail.com>2010-11-02 18:28:45 +0000
commit586463e329faf2ef760562c1dcbdc32b4dbd2804 (patch)
tree703ab80617a2b7070b82d0a9dd3cb521c85be95a /sonar-server
parent2aa3df37b9c857da35590e048c49ab5c6050b00d (diff)
downloadsonarqube-586463e329faf2ef760562c1dcbdc32b4dbd2804.tar.gz
sonarqube-586463e329faf2ef760562c1dcbdc32b4dbd2804.zip
SONAR-1911 prevent HTTP proxy from caching response
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/api/server_controller.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/server_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/server_controller.rb
index f50ec79f4fa..b033007963c 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/server_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/server_controller.rb
@@ -21,6 +21,7 @@ class Api::ServerController < Api::ApiController
skip_before_filter :check_authentication, :except => 'system'
before_filter :admin_required, :only => 'system'
+ before_filter :set_cache_buster, :only => 'index'
def key
render :text => Java::OrgSonarServerPlatform::Platform.getServer().getId()
@@ -79,4 +80,10 @@ class Api::ServerController < Api::ApiController
hash[:status_msg]='Not connected to database'
end
end
+
+ def set_cache_buster
+ response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
+ response.headers["Pragma"] = "no-cache"
+ response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
+ end
end