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 fails to return getAllow() if it was previously set to an empty collection [SPR-11917] #16536

Closed
spring-projects-issues opened this issue Jun 25, 2014 · 0 comments
Assignees
Labels
in: web status: backported type: bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Jun 25, 2014

Oliver Drotbohm opened SPR-11917 and commented

HttpHeaders headers = new HttpHeaders();
headers.setAllow(Collections.<HttpMethod> emptySet());
headers.getAllow();

This throws an exception during the accessor call, as it can't create an HttpMethod instance from the empty String. It should rather return an empty Set instead.

java.lang.IllegalArgumentException: No enum constant org.springframework.http.HttpMethod.
  at java.lang.Enum.valueOf(Enum.java:236)
  at org.springframework.http.HttpMethod.valueOf(HttpMethod.java:27)
  at org.springframework.http.HttpHeaders.getAllow(HttpHeaders.java:229)
  …

Affects: 3.2.9, 4.0.5

Backported to: 3.2.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web status: backported type: bug
Projects
None yet
Development

No branches or pull requests

2 participants