You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
openjdk version "17.0.20" 2026-07-21
OpenJDK Runtime Environment Temurin-17.0.20+8 (build 17.0.20+8)
OpenJDK 64-Bit Server VM Temurin-17.0.20+8 (build 17.0.20+8, mixed mode, sharing)
OS type/version
Windows 11
Description
Jetty 12.1.12 deprecated the existing AbstractProxyServlet.filterServerResponseHeader method and created an overload that works not with strings but with HttpField. It calls the deprecated method and then calls field.withValue. If the filtered value is different, this doesn't replace the value but adds to it. It also doesn't handle null return values correctly. This behavior is very different from version 12.1.12. I see two better implementations. The first:
How to reproduce?
Create a subclass of AbstractProxyServlet. Override the deprecated filterServerResponseHeader method to return something different for the location header, and `null`` for the date header:
if ("Location".equalsIgnoreCase(headerName)) {
return"http://localhost/proxy";
}
if ("Date".equalsIgnoreCase(headerName)) {
returnnull;
}
returnsuper.filterServerResponseHeader(clientRequest, serverResponse, headerName, headerValue);
Proxy to a URL that returns Location and Date headers.
In version 12.1.11 the client should see only one Location header value and no Date header.
In version 12.1.12 the client will see two Location header values (the original and the filtered one), and two Date header values (the original one and "null").
A possible extra option: give HttpField an extra withSingleValue(String value) method that does this:
if (this.value.equals(value)) {
returnthis;
}
returnnewHttpField(getHeader(), _name, value);
Then filterServerResponseHeader can replace the last two returns with a single return field.withSingleValue(filteredValue) call. The null check remains necessary though.
Activity
rob-spoor commentedon Aug 5, 2026
A possible extra option: give
HttpFieldan extrawithSingleValue(String value)method that does this:Then
filterServerResponseHeadercan replace the last two returns with a singlereturn field.withSingleValue(filteredValue)call. Thenullcheck remains necessary though.Fixes jetty#15548 - Replace/drop filtered proxy response headers
[SPARK-59647][BUILD] Upgrade Jetty to 12.1.13