From 586463e329faf2ef760562c1dcbdc32b4dbd2804 Mon Sep 17 00:00:00 2001 From: simonbrandhof Date: Tue, 2 Nov 2010 18:28:45 +0000 Subject: SONAR-1911 prevent HTTP proxy from caching response --- .../main/webapp/WEB-INF/app/controllers/api/server_controller.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sonar-server') 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 -- cgit v1.2.3