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

Allow for sending object by parsing them to JSON internally #376

Closed
wants to merge 1 commit into from

Conversation

Andarist
Copy link

I've spotted the TODO comment in the source code, so I have decided to fix this one.

I wasnt sure for exact semantics about what kind of objects should be allowed to be sent, possibly we need more strict checks.

Additionally I was wondering if in case of using JSON.parse we shouldnt skip escape.quote.

@brycekahle
Copy link
Contributor

Thanks for the PR! I recall this being slightly more complicated than just a simple object type check. See #205 for more discussion around this. I'm not saying your change wouldn't work, but it needs more careful consideration.

@Andarist
Copy link
Author

Andarist commented May 1, 2017

Yea, i was sure there is more into the issue than this, was just trying to start discussion on this again.

As to just using JSON.stringify here - there shouldnt be any problem. Its done on the user's side anyway in most cases. The only question is if that isObject check is enough or should it be stricter?

The trickier is for sure this. Ideally we dont need this double escaping in case of JSON, but that would be a breaking change for server's side for sure as it expects this being double escaped (didnt look into any of the code there though).

@Andarist Andarist closed this Dec 26, 2017
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

Successfully merging this pull request may close these issues.

2 participants