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

Allow parsing of media types with single-quotes [SPR-9734] #14368

Closed
spring-projects-issues opened this issue Aug 28, 2012 · 4 comments
Closed

Allow parsing of media types with single-quotes [SPR-9734] #14368

spring-projects-issues opened this issue Aug 28, 2012 · 4 comments
Assignees
Labels
in: web type: enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Aug 28, 2012

Igor Mihalik opened SPR-9734 and commented

MediaType can only parse double-quoted parameters without raising an IllegalArgumentException. This is based on comments in #13557


Affects: 3.1.2

Reference URL: 7cdc534

Issue Links:

  • #13557 Accept header with quoted parameter causes IllegalArgumentException in HttpHeaders.getContentType for the outputMessage ("depends on")

Referenced from: commits 8b09b52

0 votes, 5 watchers

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Aug 28, 2012

Rossen Stoyanchev commented

The fix is already available in the master branch. The following pull request needs to be backported to 3.1.x.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Aug 28, 2012

Igor Mihalik commented

I just want to point out that single-quoted string is considered a "token" according to RFC HTTP/1.1, not "quoted-string". So I'm not sure about all the consequences this change can cause in terms of regression.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Aug 29, 2012

Maxim Valyanskiy commented

Igor, single quotes in "Accept" header is quite common for Android 2.x web clients. Current version of Spring WebMVC denies all requests from that browsers. I think it is too big penalty for RFC violation. Maybe is is better to ignore all parse errors of Accept header and work as if headers is missing in request.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Aug 31, 2012

Rossen Stoyanchev commented

I think this is not yet fixed in 3.1.3. The following commit applied a "fix" in master. However as pointed out above, a single quote signifies a token rather than a quoted string. Some further analysis is needed.

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

No branches or pull requests

2 participants