danwrong / restler

REST client library for node.js
MIT License
1.99k stars 391 forks source link

Json response ' ' (empty string with space) produces a parseJson error. #207

Open prusik opened 9 years ago

prusik commented 9 years ago

When I call a 3rd party application using their library that depends on restler, if their response is 'empty', there is a parse error produced in restler. Unfortunately, their representation of an empty string has a space, therefore restler tries to parse the string, which results in invalid json and thus produces the error. My proposal is to trim the response before testing whether it is empty. I have created a pull request and will mention this issue in the request.

ryedog commented 9 years ago

:+1: any word on merging this PR?

easternbloc commented 9 years ago

I've added a comment on the PR