Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Uncaught exception: CORS failures with responseType "document" #1922

Closed
taralx opened this issue Jan 30, 2013 · 4 comments
Closed

Uncaught exception: CORS failures with responseType "document" #1922

taralx opened this issue Jan 30, 2013 · 4 comments

Comments

@taralx
Copy link

taralx commented Jan 30, 2013

Testcase: http://taral.dreamhosters.com/eve-test/corsreject.html

Expected result "Result: FAILURE"
Actual result "Result: " and an uncaught exception in the console.

Browser: Google Chrome 24.0.1312.56 and 26.0.1398.0

@taralx
Copy link
Author

taralx commented Feb 3, 2013

Turns out this is from accessing responseText after a failed request. Might be a Chrome bug.

@taralx
Copy link
Author

taralx commented Feb 3, 2013

Okay, so XHR2 says this about responseText:

If responseType is not the empty string or "text", throw an "InvalidStateError" exception and terminate these steps.

So we should not access reponseText in this case.

@taralx
Copy link
Author

taralx commented Feb 3, 2013

Anyone know why we query responseText at all? Is it a compat thing?

@IgorMinar
Copy link
Contributor

@taralx you are right: http://www.w3.org/TR/XMLHttpRequest/#dom-xmlhttprequest-responsetext

the responseText check is redundant and should be removed. some tests where we mock responseText will need to be changed as well.

gonzaloruizdevilla added a commit to gonzaloruizdevilla/angular.js that referenced this issue Feb 22, 2013
fixes angular#1922

Signed-off-by: Gonzalo Ruiz de Villa <gonzalo.ruizdevilla@adesis.com>
IgorMinar pushed a commit to IgorMinar/angular.js that referenced this issue Feb 24, 2013
…ular#1922

Signed-off-by: Gonzalo Ruiz de Villa <gonzalo.ruizdevilla@adesis.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants