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
leading whitespace #21
Comments
RFC8259 says that JSON text is a "value" optionally surrounded by white spaces (Section 2: JSON Grammer). So, If I'm correct, the root cause is the regular expression below. Line 6 in 6fb4e92
It should accept white spaces. I could fix the bug quickly, but it seems that we need unit tests first, otherwise we can't verify the bug fix. |
Sorry, this issue was closed against my will, because I happened to use GitHub's magic comment in the PR (i.e., "fix #number").🙌 Let me reopen this issue and I will submit a PR to really fix this issue. |
Fixed in 639a5df (sorry @NozomuIkuta quickly added fix for next release) |
TL;DR: After updating "a" laravel package our app broke because destr evaluates all responses as string.
We are using lates laravel as backend with a fairly new plain vue3 frontend.
We are using ofetch (former ohmyfetch) for fetching api responses.
After a update laravel resources responses now have a leading whitespace, thats the reason destr evaluates the response as a string.
How to reproduce:
Is is possible to trim the data before try parsing it?
The text was updated successfully, but these errors were encountered: