Response broken after modification
I have investigated the issue already, but cannot fix it yet...
The problem is that when response is modified - the content-length header remains the same, and when response length is somewhat different - client fails to render the response.
I have tried to change it a bit like this:
body.value = 1;
it works. but if you change more - it fails:
body.value = 111111;
Actually I guess that when the modified response is shorter than the original one - it will work, because the content-length header has bigger value than the actual data length. But it fails otherwise - if actual length exceeds the value of content-length header (try a few bytes gap to be sure). Once testing in a browser I have seen truncated response - that confirms my theory.
@articobandurini I've already replied to you in the mail
@articobandurini This repository handles only for JSON, and usually the interface returns JSON dynamically, without specifying the length, and the format is best specified to 'Content-Type:application/json', if it is in other formats, you can try harmon. Now callback can return a promise
Actually this is absolutely normal to have Content-Length header in the response of JSON APIs - even dynamic or static - it does not matter. It has nothing to do with Content-Type header and other formats, harmon and promises. Have you fixed Content-Length header to be equal to the length of the response?
@articobandurini I've supported the Content-Length in v0.1.5.