When content-length is set in the proxied response headers and the JSON body contains utf-8 characters the content-length send back to the client is incorrectly calculated (as json.length does not count the extra bits in a utf-8 characters).
This PR fixes the the content-length calculation for JSON responses and sends back the correct byteLength to clients. For more examples see #23.
Closes #23
When
content-length
is set in the proxied response headers and the JSON body contains utf-8 characters thecontent-length
send back to the client is incorrectly calculated (asjson.length
does not count the extra bits in a utf-8 characters).This PR fixes the the
content-length
calculation for JSON responses and sends back the correctbyteLength
to clients. For more examples see #23.