jetty.project
jetty.project copied to clipboard
Question: AbstractProxyServlet onServerResponseHeaders addHeader rather than setHeader
We have a listener implmenets org.eclipse.jetty.client.api.Response.Listener
class
and for onHeaders
method we have the following implementation
@Override
public void onHeaders(Response response) {
wrappedVersion.onHeaders(response);
}
this wrappedVersion.onHeaders
calls ProxyResponseListener
then calls AbstractProxyServlet's onServerResponseHeaders
method which calls addHeader
.
This is a problem for us because we have configured org.eclipse.jetty.servlets.CrossOriginFilter
which has handleSimpleResponse
which calls response.setHeader(ACCESS_CONTROL_ALLOW_ORIGIN_HEADER, origin);
And this CORS filter is called before our filter. Which means for our filter onHeaders
, rather than replacing the headers, it actually added more headers.
I wonder why Jetty doesn't do setHeader
in onServerResponseHeaders
? I am guessing this is because we do not want to lose any set cookie headers?
And what would be a better design if its something we can improve on our side?
thanks
@sbordet old jetty-client API question.
This issue has been automatically marked as stale because it has been a full year without activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been closed due to it having no activity.
This issue has been automatically marked as stale because it has been a full year without activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has been a full year without activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has been a full year without activity. It will be closed if no further activity occurs. Thank you for your contributions.