Closed robertknight closed 7 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
:+1:
Thanks for this fix, @robertknight.
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.
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