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

Should warn properly if requestbody is not json #1

Open
mokkabonna opened this issue Oct 28, 2021 · 0 comments
Open

Should warn properly if requestbody is not json #1

mokkabonna opened this issue Oct 28, 2021 · 0 comments

Comments

@mokkabonna
Copy link
Owner

mokkabonna commented Oct 28, 2021

Currently it just fails at ./lib/index.js:128 with SyntaxError: Unexpected token u in JSON at position 0

xhr.requestBody = JSON.parse(xhr.requestBody)

Should properly notify that the client sent header indicating JSON, but did not send proper json.

A normal api would return a 4xx error probably, but we should probably not assume that.

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

1 participant