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

Fix: Ignore read-only headers in DedupeResponseHeaderGatewayFilterFactory #3600

Closed

Conversation

alex-cova
Copy link

This pull request includes one change to the DedupeResponseHeaderGatewayFilterFactory class which now ignores the headers if they are read-only.

Reason:

If the headers are read-only, the dedupe method throws UnsupportedOperationException

Solve:

If the headers are read-only, ignore it.

if (headers.getClass().getName().equals("org.springframework.http.ReadOnlyHttpHeaders")) {
    return;
}

A try-catch block may be more suitable...

@spencergibb
Copy link
Member

Upcoming versions of framework and boot should fix the read only headers problem, so this shouldn't be needed. And you should compare classes with .class not a string compare.

@alex-cova
Copy link
Author

Upcoming versions of framework and boot should fix the read only headers problem, so this shouldn't be needed. And you should compare classes with .class not a string compare.

I Agree but, org.springframework.http.ReadOnlyHttpHeaders is not public, it's package-private

@spencergibb
Copy link
Member

Either way, this shouldn't be needed at all

@alex-cova alex-cova closed this Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants