Better fix for the duplicate Date header.
This commit is contained in:
parent
93324644b2
commit
4369e1d242
|
@ -534,6 +534,10 @@ public class ProxyServlet extends HttpServlet
|
|||
|
||||
protected void onResponseHeaders(HttpServletRequest request, HttpServletResponse response, Response proxyResponse)
|
||||
{
|
||||
// Clear the response headers in case it comes with predefined ones.
|
||||
for (String name : response.getHeaderNames())
|
||||
response.setHeader(name, null);
|
||||
|
||||
for (HttpField field : proxyResponse.getHeaders())
|
||||
{
|
||||
String headerName = field.getName();
|
||||
|
@ -545,7 +549,7 @@ public class ProxyServlet extends HttpServlet
|
|||
if (newHeaderValue == null || newHeaderValue.trim().length() == 0)
|
||||
continue;
|
||||
|
||||
response.setHeader(headerName, newHeaderValue);
|
||||
response.addHeader(headerName, newHeaderValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue