Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: AbstractProxyServlet onServerResponseHeaders addHeader rather than setHeader #577

Open
tongc opened this issue May 18, 2016 · 7 comments
Assignees

Comments

@tongc
Copy link

tongc commented May 18, 2016

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

@tongc tongc changed the title AbstractProxyServlet onServerResponseHeaders addHeader rather than setHeader Question: AbstractProxyServlet onServerResponseHeaders addHeader rather than setHeader May 18, 2016
@joakime
Copy link
Contributor

joakime commented Mar 22, 2019

@sbordet old jetty-client API question.

@stale
Copy link

stale bot commented Mar 21, 2020

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.

@stale stale bot added the Stale For auto-closed stale issues and pull requests label Mar 21, 2020
@sbordet sbordet removed the Stale For auto-closed stale issues and pull requests label Mar 24, 2020
@stale
Copy link

stale bot commented Apr 23, 2020

This issue has been closed due to it having no activity.

@stale
Copy link

stale bot commented Jun 2, 2021

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.

@stale stale bot added the Stale For auto-closed stale issues and pull requests label Jun 2, 2021
@sbordet sbordet removed the Stale For auto-closed stale issues and pull requests label Jun 4, 2021
@github-actions
Copy link

github-actions bot commented Jun 6, 2022

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.

@github-actions github-actions bot added the Stale For auto-closed stale issues and pull requests label Jun 6, 2022
@sbordet sbordet removed the Stale For auto-closed stale issues and pull requests label Jun 13, 2022
@github-actions
Copy link

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.

@github-actions github-actions bot added the Stale For auto-closed stale issues and pull requests label Jun 16, 2023
@sbordet sbordet added Help Wanted and removed Stale For auto-closed stale issues and pull requests labels Jun 16, 2023
Copy link

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.

@github-actions github-actions bot added the Stale For auto-closed stale issues and pull requests label Jun 17, 2024
@sbordet sbordet removed the Stale For auto-closed stale issues and pull requests label Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants