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

MediaRange does not accept space after semicolon #237

Closed
neofreko opened this issue May 24, 2022 · 2 comments
Closed

MediaRange does not accept space after semicolon #237

neofreko opened this issue May 24, 2022 · 2 comments

Comments

@neofreko
Copy link

on version 3.8.1
Per w3 spec, the can be space after semicolon. Eg:
audio/*; q=0.2, audio/basic

In my case, I found it when server returns:
application/json; charset=utf-8

However, current implementation fails on above example.

Probable fix:
([^\s\/]+)\/([^\s+;]+)(?:\+([^\s;]+))?((?:;\s*[^\s;=]+=(?:[^\s";=]+|"(?:[^\"]|\\.)*"))+)?

@kerrykimbrough
Copy link
Contributor

You're right. Although the media range grammar doesn't show it, HTTP basic rules allow "linear white space" (LWS) between tokens and separators. Will fix soon in next release.

@kerrykimbrough
Copy link
Contributor

Fixed in release 3.8.2

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

No branches or pull requests

2 participants