use of org.eclipse.scout.rt.server.commons.servlet.cache.HttpResponseHeaderContributor in project scout.rt by eclipse.
the class HtmlFileLoader method loadResource.
@Override
public HttpCacheObject loadResource(HttpCacheKey cacheKey) throws IOException {
String pathInfo = cacheKey.getResourcePath();
BinaryResource content = loadResource(pathInfo);
if (content == null) {
return null;
}
// no cache-control, only E-Tag checks to make sure that a session with timeout is correctly
// forwarded to the login using a GET request BEFORE the first json POST request
HttpCacheObject httpCacheObject = new HttpCacheObject(cacheKey, content);
// Suppress automatic "compatibility mode" in IE in intranet zone
httpCacheObject.addHttpResponseInterceptor(new HttpResponseHeaderContributor("X-UA-Compatible", "IE=edge") {
private static final long serialVersionUID = 1L;
@Override
public void intercept(HttpServletRequest req, HttpServletResponse resp) {
HttpClientInfo httpClientInfo = HttpClientInfo.get(req);
if (httpClientInfo.isMshtml()) {
// Send headers only for IE
super.intercept(req, resp);
}
}
});
return httpCacheObject;
}
Aggregations