xdomain icon indicating copy to clipboard operation
xdomain copied to clipboard

getAllResponseHeaders does not include trailing CRLF

Open jsedlacek opened this issue 8 years ago • 2 comments

According to spec, the getAllResponseHeaders should include trailing CRLF: https://xhr.spec.whatwg.org/#the-getallresponseheaders()-method

Xdomains implementation does not contain trailing CRLF. https://github.com/jpillora/xdomain/blob/gh-pages/vendor/xhook.js#L226

This breaks behavior of superagent, which pops the trailing CRLF: https://github.com/visionmedia/superagent/blob/master/lib/client.js#L203

With xdomain trailing CRLF is not present, so the last header gets stripped.

jsedlacek avatar Sep 07 '17 19:09 jsedlacek

Thanks, this should be fixed in jpillora/xhook On Fri, 8 Sep 2017 at 5:44 am Jakub Sedlacek [email protected] wrote:

According to spec, the getAllResponseHeaders should include trailing CRLF: https://xhr.spec.whatwg.org/#the-getallresponseheaders()-method

Xdomains implementation does not contain trailing CRLF. https://github.com/jpillora/xdomain/blob/gh-pages/vendor/xhook.js#L226

This breaks behavior of superagent, which pops the trailing CRLF: https://github.com/visionmedia/superagent/blob/master/lib/client.js#L203

With xdomain trailing CRLF is not present, so the last header gets stripped.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jpillora/xdomain/issues/202, or mute the thread https://github.com/notifications/unsubscribe-auth/AAmr81wkQTF83qt2hTyjgcyxq6mUQh26ks5sgEeqgaJpZM4PQTI3 .

jpillora avatar Sep 07 '17 22:09 jpillora

Thanks, I have created the upstream issue as well. https://github.com/jpillora/xhook/issues/72

jsedlacek avatar Sep 08 '17 08:09 jsedlacek