aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Becker2012-07-16 12:57:16 (EDT)
committerThomas Becker2012-07-16 12:57:16 (EDT)
commite7658ba829c5a0ca8d9ae966737ed1d8e639d7b6 (patch)
tree4ef93b72c946c45e9f92cc6a08b48a171230dba9
parentb62473b58ffed771d39dc47262b7607a05163328 (diff)
downloadorg.eclipse.jetty.project-e7658ba829c5a0ca8d9ae966737ed1d8e639d7b6.zip
org.eclipse.jetty.project-e7658ba829c5a0ca8d9ae966737ed1d8e639d7b6.tar.gz
org.eclipse.jetty.project-e7658ba829c5a0ca8d9ae966737ed1d8e639d7b6.tar.bz2
385136: set header prefix in IncludableGzipFilter to make sure that header is being setrefs/changes/98/6798/1
-rw-r--r--jetty-servlets/src/main/java/org/eclipse/jetty/servlets/IncludableGzipFilter.java24
1 files changed, 21 insertions, 3 deletions
diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/IncludableGzipFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/IncludableGzipFilter.java
index 50ee23a..f6a308b 100644
--- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/IncludableGzipFilter.java
+++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/IncludableGzipFilter.java
@@ -79,6 +79,15 @@ public class IncludableGzipFilter extends GzipFilter
{
return new GZIPOutputStream(_response.getOutputStream(),_bufferSize);
}
+
+ @Override
+ protected void setHeader(String name, String value)
+ {
+ super.setHeader(name, value);
+ HttpServletResponse response = (HttpServletResponse)getResponse();
+ if (!response.containsHeader(name))
+ response.setHeader("org.eclipse.jetty.server.include." + name, value);
+ }
};
}
};
@@ -97,6 +106,15 @@ public class IncludableGzipFilter extends GzipFilter
{
return new DeflaterOutputStream(_response.getOutputStream(),new Deflater(_deflateCompressionLevel, _deflateNoWrap));
}
+
+ @Override
+ protected void setHeader(String name, String value)
+ {
+ super.setHeader(name, value);
+ HttpServletResponse response = (HttpServletResponse)getResponse();
+ if (!response.containsHeader(name))
+ response.setHeader("org.eclipse.jetty.server.include." + name, value);
+ }
};
}
};
@@ -108,8 +126,8 @@ public class IncludableGzipFilter extends GzipFilter
configureWrappedResponse(wrappedResponse);
return wrappedResponse;
}
-
-
+
+
// Extend CompressedResponseWrapper to be able to set headers during include and to create unchecked printwriters
private abstract class IncludableResponseWrapper extends CompressedResponseWrapper
{
@@ -124,7 +142,7 @@ public class IncludableGzipFilter extends GzipFilter
super.setHeader(name,value);
HttpServletResponse response = (HttpServletResponse)getResponse();
if (!response.containsHeader(name))
- response.setHeader("org.eclipse.jetty.server.include."+name,value);;
+ response.setHeader("org.eclipse.jetty.server.include."+name,value);
}
@Override
protected PrintWriter newWriter(OutputStream out, String encoding) throws UnsupportedEncodingException