You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have read the FAQ and my issue was not answered there
What version of Zog are you using
v0.16.0
Describe the bug
Some HTTP clients send values for Content-Type headers with a charset appended to it. E.g. axios (JS HTTP library) will send this header by default: Content-Type: application/json;charset=utf-8, which zhttp cannot detect using its simple switch statement. While it can be changed to just application/json on the client side, a more robust content-type detection can be implemented on Zog's part (using strings.Contains?).
To Reproduce
I think looking in the source code should be enough. Otherwise it can be reproduced using any HTTP client against a server using zhttp, just send this header: Content-Type: application/json;charset=utf-8.
Expected behavior
zhttp should detect a more complex Content-Type values with any directive specified after a semicolon following the content type.
Before you begin
What version of Zog are you using
v0.16.0
Describe the bug
Some HTTP clients send values for
Content-Type
headers with a charset appended to it. E.g.axios
(JS HTTP library) will send this header by default:Content-Type: application/json;charset=utf-8
, whichzhttp
cannot detect using its simple switch statement. While it can be changed to justapplication/json
on the client side, a more robust content-type detection can be implemented on Zog's part (usingstrings.Contains
?).To Reproduce
I think looking in the source code should be enough. Otherwise it can be reproduced using any HTTP client against a server using zhttp, just send this header:
Content-Type: application/json;charset=utf-8
.Expected behavior
zhttp should detect a more complex Content-Type values with any directive specified after a semicolon following the content type.
Additional context
charset
is an allowed directive in Content-Type header: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type#directivesThe text was updated successfully, but these errors were encountered: