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

Throw 411 error for unsupported data types #53

Merged
merged 5 commits into from
May 22, 2015
Merged

Throw 411 error for unsupported data types #53

merged 5 commits into from
May 22, 2015

Conversation

SimonWoolf
Copy link
Member

Fixes #52

@SimonWoolf
Copy link
Member Author

I would like the success case first (ie string or buffer).

Done

I'm also mildly irked that the isObject() and isArray() checks each call toString() but I'll live with it.

I tried data.constructor == Object, but that kept evaluating false when run in nodeunit for, even though was true when in-browser, not sure why

@paddybyers
Copy link
Member

but that kept evaluating false

Different contexts (eg iframes) each have a copy of these globals. The check is the correct one.

@SimonWoolf
Copy link
Member Author

forgot about this pr :)

check string, then buffer, then others

nb needed to tweak isArrayBuffer to stop it erroring when fed null/undefined, if you want that check to come before the null check - 95e6a72 9decb6c

@SimonWoolf SimonWoolf force-pushed the verify branch 2 times, most recently from 13e1388 to 8a77355 Compare May 21, 2015 15:46
@SimonWoolf SimonWoolf merged commit fe74a1d into master May 22, 2015
SimonWoolf added a commit that referenced this pull request May 22, 2015
@SimonWoolf SimonWoolf deleted the verify branch August 4, 2015 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Agree on handling of JSON value types
2 participants