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

HttpHeaders.keySet() is no longer case-insensitive [SPR-15087] #19653

Closed
spring-projects-issues opened this issue Jan 3, 2017 · 4 comments
Closed
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: regression A bug that is also a regression
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jan 3, 2017

Andy Wilkinson opened SPR-15087 and commented

This is a regression due to #19593. Consider the following:

HttpHeaders headers = new HttpHeaders();
headers.add("X-Foo", "bar");
System.out.println(headers.keySet().contains("x-foo"));

With M3 it outputs true. With M4 it outputs false.


Affects: 5.0 M4

Issue Links:

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jan 9, 2017

Juergen Hoeller commented

Any specific reason why you're calling keySet().contains instead of simply containsKey there? It's a regression in any case, just wondering...

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jan 9, 2017

Andy Wilkinson commented

There's some separation between the code that's dealing with HttpHeaders and the code that checks to see if a particular header exists. The latter code is passed a Set of the header names so it can't use containsKey.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jan 10, 2017

Juergen Hoeller commented

We're overriding containsKey on our internal LinkedHashMap now, implicitly picked up by its keySet() implementation.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jan 10, 2017

Christoph Dreis commented

Hey. Was just wondering, if this will be backported to 4.3.x? Considering #19593 has also the fix version of 4.3.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: regression A bug that is also a regression
Projects
None yet
Development

No branches or pull requests

2 participants