express-jwt-proxy icon indicating copy to clipboard operation
express-jwt-proxy copied to clipboard

JSON body returned as string instead of JSON

Open johanforssell opened this issue 9 years ago • 1 comments

Using the latest 0.6.2 from npmjs.com!

makeProxiedCall() have multiple calls to res.json(body);.

For some reason this is not working correctly for me - I'm getting back the json data as a string. If I json-parse the body before using it I get correct data. Like so:

res.json(JSON.parse(body));

johanforssell avatar Feb 12 '16 15:02 johanforssell

@johanforssell You raise a good point, and perhaps it is appropriate for express-jwt-proxy to always parse API responses before handing them off. Up to now I've been receiving them as strings and parsing them in my superagent responses. I believe a few others have encountered this as well.

bdefore avatar Feb 16 '16 00:02 bdefore