browserify / http-browserify

node's http module, but for the browser
MIT License
244 stars 110 forks source link

Fix exception when setting XHR responseType parameter #66

Closed robertknight closed 7 years ago

robertknight commented 9 years ago

According to the XHR spec (http://xhr.spec.whatwg.org/#the-responsetype-attribute) and https://bugzilla.mozilla.org/show_bug.cgi?id=707484 it is legal to set the responseType attribute before opening the request. However, this doesn't work with current versions of Firefox and results in an exception.

Work around this issue by setting the xhr.responseType attribute only after opening the request.

Also if the caller explicitly specifies a desired response type, report an error instead of silently returning an unexpected data type if the xhr.responseType assignment fails.

Fixes #65

robertknight commented 9 years ago

Ah, I've just realized that this is essentially the same change as in https://github.com/substack/http-browserify/pull/61/commits

cardoni commented 9 years ago

:+1:

anandthakker commented 9 years ago

Thanks for this fix, @robertknight.

robertknight commented 7 years ago

This issue was fixed a year ago upstream in Firefox, so I'm going to close this for now unless anyone else wants to revive it.