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

Request accept headers are parsed in some places as MIME types #24

Open
gcotelli opened this issue Oct 10, 2018 · 2 comments
Open

Request accept headers are parsed in some places as MIME types #24

gcotelli opened this issue Oct 10, 2018 · 2 comments

Comments

@gcotelli
Copy link
Contributor

Hi
I've noticed some senders of accept in the codebase that are doing asZnMimeType.
The accept headers can have the form:

Accept: text/html, application/xhtml+xml, application/xml;q=0.9, */*;q=0.8

according to https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept .
When this is parsed by asZnMimeType it will not fail but the resulting object is not valid.

@svenvc
Copy link
Owner

svenvc commented Oct 10, 2018

Hmm, yes apparently the value of the Accept: header value is collection of multiple mime-types.

https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

I'll have to look at this in more detail.

In which scenario are you encountering this ?

Thx for reporting this.

@gcotelli
Copy link
Contributor Author

I'm just using Zinc for some REST API and noticed this issue searching for some way to select the right MIME type to use for a response. So I browse the senders and noticed this cases in the own Zinc code that can be problematic.

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