You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 15, 2023. It is now read-only.
One for the list:
I have endpoints that use JSON-vulnerability protection. That means it adds )]}, before the start of the response-json, making it invalid. (this protection is widely used, among others, angular supports parsing these responses).
When encountered with this response node doesn't view this as JSON, but just returnes the string.
This might actually be the behaviour noticed in #94 :-)
I did not find a way to solve this with request-options, so we probably would need to parse the string.
(if anyone knows of a way to solve this with request: plz comment)
I see to other ways to solve this:
add a config options: useJSONvulnerability (or something shorter ;-)) and then do this in the response-handler:
function(error, res, body) {
if (error) return done(error);
body = JSON.parse(body.substring(5));
// test your stuff
}
Assume what's reasonable: If using JSON-request, simply check if typeof body === 'string' and then do the above.
Please share your thoughts on this, I will do this right after test-refactoring
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
One for the list:
I have endpoints that use JSON-vulnerability protection. That means it adds )]}, before the start of the response-json, making it invalid. (this protection is widely used, among others, angular supports parsing these responses).
When encountered with this response node doesn't view this as JSON, but just returnes the string.
This might actually be the behaviour noticed in #94 :-)
I did not find a way to solve this with request-options, so we probably would need to parse the string.
(if anyone knows of a way to solve this with request: plz comment)
I see to other ways to solve this:
typeof body === 'string'
and then do the above.Please share your thoughts on this, I will do this right after test-refactoring
The text was updated successfully, but these errors were encountered: