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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃悰 BodyParser doesn't detect chartset content-types without spaces #650
Comments
Thanks for opening your first issue here! 馃帀 Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord |
thanks for the bug report problem is that the content-type header of your request is not perfect, there must be a space between the mime type and the charset declaration your header:
content-type: application/json;charset=utf-8
expected header:
content-type: application/json; charset=utf-8 we have optimized the bodyparser in https://github.com/gofiber/fiber/releases/tag/v1.13.0 and this new behaviour is more strictly, which brings performance the change: https://github.com/gofiber/fiber/blob/master/utils.go#L305 |
Thanks for the clarification. I just changed this in my app and everything works fine now. Hope this will help if anyone else face this situation. |
Thanks for the explanation, the extra space fixes it. However, this causes many issues while the performance gain is minimal. E.g.
Please reopen this, thanks. |
@jos- I was able to solve this, setting an interceptor into my axios.
|
@eduardohitek The specification of media types, RFC 2045, does not require a space. Neither does it prohibit a space; this is more implicit, since RFC 2045 refers to the extended BNF as defined in RFC 822, which clarifies this in clause 3.4.2. After reading the statement above, we will allow missing spaces in the Content-Type in the next tag 馃憣 @jos- we fixed the case sensitive issue in #655 Thanks guys for the reports, should be tagged this week 馃憤 |
@eduardohitek Thanks, I was able to do the same by specifying This works in e.g. Firefox, but not in Chrome/Brave/Chromium, which somehow always sets the charset of PUT/POST requests to uppercase UTF-8 when you specify a charset. @Fenny Thanks for reopening the issue. fiber gives me the error |
Thanks for the quick fix. Thanks for this great framework 馃憤 |
Thank u guys!!!! |
Fiber v1.13.1
Fiber is unable to parse a application/json;charset=utf-8 content-type. It was working on v1.12.x version.
Code snippet
The text was updated successfully, but these errors were encountered: