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

Guard against invalid JSON #2

Closed
trieloff opened this issue May 27, 2021 · 3 comments
Closed

Guard against invalid JSON #2

trieloff opened this issue May 27, 2021 · 3 comments

Comments

@trieloff
Copy link
Contributor

trieloff commented May 27, 2021

Invalid JSON bodies just fail badly with an error 500:

stderr | 1cc70987 | abort: Unexpected input end in ~lib/assemblyscript-json/decoder.ts(156:5)

I'm not sure how to catch parse errors with assemblyscript-json yet.

@trieloff
Copy link
Contributor Author

See near/assemblyscript-json#225

@davidnuescheler
Copy link

hmm... also, are there some that are sent by browsers, or is this just from testing?
considering this...

https://github.com/adobe/theblog/blob/master/scripts/martech.js#L164

i would be really surprised if actual browsers send something broken here.

@trieloff
Copy link
Contributor Author

Me too, and so far the only occurrence is this one:

stdout | 41c8d0b1 | request received{"time":1622134614271,"host":"rum.hlx3.page","url":"https://rum.hlx3.page/.rum/1","user_agent":"lars is messing around","CLS":1.0,"LCP":1.0}
stderr | 1cc70987 | abort: Unexpected input end in ~lib/assemblyscript-json/decoder.ts(156:5)

The user agent tells the story.

trieloff added a commit that referenced this issue Jul 30, 2021
@trieloff trieloff closed this as completed Jul 5, 2023
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