Fix caching rules by upgrading to gwtexpui 1.3

Use the new CacheHeaders class to define consistent caching rules
throughout the code. This removes a lot of copy-and-paste for the
setNotCacheable case, and ensures cacheable rules are consistent
with the way CacheControlFilter works on secure responses.

Change-Id: Ibdf1d76095e3623980b4ca8585cf654a5018b553
This commit is contained in:
Shawn Pearce
2013-01-11 12:39:45 -08:00
parent 89136bc832
commit 1756441516
19 changed files with 52 additions and 84 deletions

View File

@@ -14,6 +14,7 @@
package com.google.gerrit.httpd.auth.openid;
import com.google.gwtexpui.server.CacheHeaders;
import com.google.inject.Inject;
import com.google.inject.Singleton;
@@ -44,9 +45,7 @@ class OpenIdLoginServlet extends HttpServlet {
public void doPost(final HttpServletRequest req, final HttpServletResponse rsp)
throws IOException {
try {
rsp.setHeader("Expires", "Fri, 01 Jan 1980 00:00:00 GMT");
rsp.setHeader("Pragma", "no-cache");
rsp.setHeader("Cache-Control", "no-cache, must-revalidate");
CacheHeaders.setNotCacheable(rsp);
impl.doAuth(req, rsp);
} catch (Exception e) {
getServletContext().log("Unexpected error during authentication", e);