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

completeRequest issue in 1.2.0rc3 #4587

Closed
Dukeman330 opened this issue Oct 22, 2013 · 2 comments
Closed

completeRequest issue in 1.2.0rc3 #4587

Dukeman330 opened this issue Oct 22, 2013 · 2 comments

Comments

@Dukeman330
Copy link

Between rc2 and rc3, the assignment of the "protocol" variable in the completeRequest function (line 7090) has flipped the order for where it tries to find a protocol. Previously (in rc2 and prior), it was first checking the actual request for the protocol before trying to get it from locationProtocol, now in RC3 it reads:

var protocol = locationProtocol || urlResolve(url).protocol;

This happened to break compatibility for me in PhoneGap/Cordova - the code making the call is stored locally, with the file:// protocol, while the site I'm making requests to is on an http:// protocol. (NOTE: I know this is technically an XSS - PhoneGap has its own domain whitelisting system for preventing this from being a security hole)

@tzaavi
Copy link

tzaavi commented Oct 24, 2013

I have the same issue. All http requests that response with text get the status code converted to 200.

status = (protocol == 'file') ? (response ? 200 : 404) : status;

So if I return 500 with text explain the problem the status code converted to 200 and the success callback is executed.

@sohai
Copy link

sohai commented Oct 24, 2013

related #4436

jamesdaily pushed a commit to jamesdaily/angular.js that referenced this issue Jan 27, 2014
…file:// apps

Previously if an app was running from file:// origin we would always return either
http 200 or 404 depending on whether the response was present.

This changes the behavior so that we do this only if the protocol of the request
(not the origin) is file:// and only if the status code is 0.

Closes angular#4436
Closes angular#4587
Closes angular#4514
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this issue Jan 27, 2014
…file:// apps

Previously if an app was running from file:// origin we would always return either
http 200 or 404 depending on whether the response was present.

This changes the behavior so that we do this only if the protocol of the request
(not the origin) is file:// and only if the status code is 0.

Closes angular#4436
Closes angular#4587
Closes angular#4514
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants