New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CORS HTTP patch request is not working on IE10/11 #1684

Closed
tomchentw opened this Issue Oct 8, 2014 · 27 comments

Comments

Projects
None yet
5 participants
@tomchentw

See #1684 (comment) for latest update.

@dmethvin

This comment has been minimized.

Show comment
Hide comment
@dmethvin

dmethvin Oct 13, 2014

Member

I think that diagnoses the cause, but I am wondering why patch is left out. Is RFC 5789 actually a standard now?

Member

dmethvin commented Oct 13, 2014

I think that diagnoses the cause, but I am wondering why patch is left out. Is RFC 5789 actually a standard now?

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Oct 16, 2014

Member

This is weird. In IE8 PATCH is supported only via ActiveX, is it supported in IE10/11 only via native XHR? O_o

Member

mgol commented Oct 16, 2014

This is weird. In IE8 PATCH is supported only via ActiveX, is it supported in IE10/11 only via native XHR? O_o

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Nov 6, 2014

Member

The 1.x fiddle (http://jsfiddle.net/tomchentw/hnL7yt7v/) works fine for me on BrowserStack on IE10/11 (see screenshot from IE11 on Windows 8.1):
screen shot 2014-11-06 at 13 05 43

I'm unable to reproduce the reported bug.

Member

mgol commented Nov 6, 2014

The 1.x fiddle (http://jsfiddle.net/tomchentw/hnL7yt7v/) works fine for me on BrowserStack on IE10/11 (see screenshot from IE11 on Windows 8.1):
screen shot 2014-11-06 at 13 05 43

I'm unable to reproduce the reported bug.

@tomchentw

This comment has been minimized.

Show comment
Hide comment
@tomchentw

tomchentw Nov 6, 2014

I'm guessing it might be an issue of IE vm. Any native windows user can help test out?

I'm guessing it might be an issue of IE vm. Any native windows user can help test out?

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Nov 6, 2014

Member

I'm guessing it might be an issue of IE vm. Any native windows user can
help test out?

That'd be @dmethvin. :-)

Member

mgol commented Nov 6, 2014

I'm guessing it might be an issue of IE vm. Any native windows user can
help test out?

That'd be @dmethvin. :-)

@markelog

This comment has been minimized.

Show comment
Hide comment
@markelog

markelog Nov 7, 2014

Member

IE vm

I think there shouldn't be a difference between IE on VM and "real" IE, only diff that could be there if versions are different, @tomchentw could you post your IE 10/11 versions?

@mzgol could you do that too?

Member

markelog commented Nov 7, 2014

IE vm

I think there shouldn't be a difference between IE on VM and "real" IE, only diff that could be there if versions are different, @tomchentw could you post your IE 10/11 versions?

@mzgol could you do that too?

@markelog markelog added the Ajax label Nov 7, 2014

@markelog

This comment has been minimized.

Show comment
Hide comment
@markelog

markelog Nov 7, 2014

Member

Couldn't reproduce that too.

IE 10 - 10.0.9200.16384, Windows 8
IE 11 - 11.0.9600.16663, Windows 8.1

Member

markelog commented Nov 7, 2014

Couldn't reproduce that too.

IE 10 - 10.0.9200.16384, Windows 8
IE 11 - 11.0.9600.16663, Windows 8.1

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Nov 7, 2014

Member

@mzgol could you do that too?

Sure, although, AFAIK, IE10 wasn't updated so drastically as IE11 is during its lifetime.

It works for me on:

On BrowserStack:
IE10: 10.0.9200.17028 on Windows 7
IE11: 11.0.9600.17207 on Windows 7, 11.0.9600.16663 on Windows 8.1 (oh, I hoped BrowserStack is updating it more often...)

On local machines:
IE10: 10.0.9200.17116 on Windows 7 (an image from https://modern.ie)
IE11: 11.0.9600.17351 on Windows 8.1 (my private Windows copy installed via BootCamp and run via Parallels)

Member

mgol commented Nov 7, 2014

@mzgol could you do that too?

Sure, although, AFAIK, IE10 wasn't updated so drastically as IE11 is during its lifetime.

It works for me on:

On BrowserStack:
IE10: 10.0.9200.17028 on Windows 7
IE11: 11.0.9600.17207 on Windows 7, 11.0.9600.16663 on Windows 8.1 (oh, I hoped BrowserStack is updating it more often...)

On local machines:
IE10: 10.0.9200.17116 on Windows 7 (an image from https://modern.ie)
IE11: 11.0.9600.17351 on Windows 8.1 (my private Windows copy installed via BootCamp and run via Parallels)

@markelog

This comment has been minimized.

Show comment
Hide comment
@markelog

markelog Nov 7, 2014

Member

@tomchentw that might mean that you have some policy restrictions in your browser

Member

markelog commented Nov 7, 2014

@tomchentw that might mean that you have some policy restrictions in your browser

@tomchentw

This comment has been minimized.

Show comment
Hide comment
@tomchentw

tomchentw Nov 7, 2014

@mzgol @markelog I clean installed Yosemite so it took me some time to reinstall PD9 + ModernIE.
Yes, I can't reproduce with the fiddle on IE10/win7: http://jsfiddle.net/tomchentw/hnL7yt7v/
It works perfectly.

However, if I switch Frameworks & Extensions from jquery 1.x-master to jquery 1.11.0 and run it again, it is NOT working. Same issue for 1.10.0 and 1.8.3. Any ideas?

@mzgol @markelog I clean installed Yosemite so it took me some time to reinstall PD9 + ModernIE.
Yes, I can't reproduce with the fiddle on IE10/win7: http://jsfiddle.net/tomchentw/hnL7yt7v/
It works perfectly.

However, if I switch Frameworks & Extensions from jquery 1.x-master to jquery 1.11.0 and run it again, it is NOT working. Same issue for 1.10.0 and 1.8.3. Any ideas?

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Nov 7, 2014

Member

However, if I switch Frameworks & Extensions from jquery 1.x-master to jquery 1.11.0 and run it again, it is NOT working. Same issue for 1.10.0 and 1.8.3. Any ideas?

Ahh... Silly me. This is because of jsfiddle/jsfiddle-issues#555. Basically, jquery 1.x-master actually points to the latest commit for the jQuery version that doesn't support IE<9.

Can you recreate your fiddle on http://jsbin.com/? They're much more responsive than jsFiddle maintainers and the jQuery Compat WIP (via git) is what jquery 1.x-master used to be; they've already fixed their links via my PR. Please read http://blog.jquery.com/2014/10/29/jquery-3-0-the-next-generations/ for further context.

Member

mgol commented Nov 7, 2014

However, if I switch Frameworks & Extensions from jquery 1.x-master to jquery 1.11.0 and run it again, it is NOT working. Same issue for 1.10.0 and 1.8.3. Any ideas?

Ahh... Silly me. This is because of jsfiddle/jsfiddle-issues#555. Basically, jquery 1.x-master actually points to the latest commit for the jQuery version that doesn't support IE<9.

Can you recreate your fiddle on http://jsbin.com/? They're much more responsive than jsFiddle maintainers and the jQuery Compat WIP (via git) is what jquery 1.x-master used to be; they've already fixed their links via my PR. Please read http://blog.jquery.com/2014/10/29/jquery-3-0-the-next-generations/ for further context.

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Nov 7, 2014

Member

OK, here it is: http://jsbin.com/qefabu/1/edit. Click on Run with JS.

Member

mgol commented Nov 7, 2014

OK, here it is: http://jsbin.com/qefabu/1/edit. Click on Run with JS.

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Nov 7, 2014

Member

Now in IE11 on Windows 8.1, both via BrowserStack and on a local VM I'm getting errors logged:

{
  "readyState": 0,
  "status": 0,
  "statusText": "Error: Permission denied"
}

In IE10/IE11 on Windows 7 via BrowserStack I see the error:

{
  "readyState": 0,
  "status": 0,
  "statusText": "Error: Could not complete the operation due to error 8070000c."
}

Sorry for the fuss with versions and wasting everyone's time, I should've remembered about the change, I made it myself after all.

EDIT: fixed the responses, I pasted the wrong ones before.

Member

mgol commented Nov 7, 2014

Now in IE11 on Windows 8.1, both via BrowserStack and on a local VM I'm getting errors logged:

{
  "readyState": 0,
  "status": 0,
  "statusText": "Error: Permission denied"
}

In IE10/IE11 on Windows 7 via BrowserStack I see the error:

{
  "readyState": 0,
  "status": 0,
  "statusText": "Error: Could not complete the operation due to error 8070000c."
}

Sorry for the fuss with versions and wasting everyone's time, I should've remembered about the change, I made it myself after all.

EDIT: fixed the responses, I pasted the wrong ones before.

@tomchentw

This comment has been minimized.

Show comment
Hide comment
@tomchentw

tomchentw Nov 7, 2014

OK, here it is: http://jsbin.com/qefabu/1/edit. Click on Run with JS.

Thanks for the update, I updated the first post in this thread to point to that JSbin.

I got the same result as you did on (IE10/Win7/ModernIE).

OK, here it is: http://jsbin.com/qefabu/1/edit. Click on Run with JS.

Thanks for the update, I updated the first post in this thread to point to that JSbin.

I got the same result as you did on (IE10/Win7/ModernIE).

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Nov 7, 2014

Member

BTW, jsFiddle has just fixed their links & names for edge versions.

Member

mgol commented Nov 7, 2014

BTW, jsFiddle has just fixed their links & names for edge versions.

@tomchentw

This comment has been minimized.

Show comment
Hide comment
@tomchentw

tomchentw Nov 7, 2014

WOW! Great Open Source.

WOW! Great Open Source.

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Nov 7, 2014

Member

Could it be that The ActiveX XHR doesn't cooperate with CORS, at least for PATCH requests?

Ideally we would do this in jQuery Compat for XHR on IE:

  1. If request is local, use the ActiveX one.
  2. If IE>=9, use native XHR.
  3. If IE8 and we're using sth different than get|post|head|put|delete|options, use ActiveX.
  4. If IE8 and we're using one of get|post|head|put|delete|options, use the native XHR.

Am I right? Now it'd be nice to be able to do this without UA-sniffing.

Member

mgol commented Nov 7, 2014

Could it be that The ActiveX XHR doesn't cooperate with CORS, at least for PATCH requests?

Ideally we would do this in jQuery Compat for XHR on IE:

  1. If request is local, use the ActiveX one.
  2. If IE>=9, use native XHR.
  3. If IE8 and we're using sth different than get|post|head|put|delete|options, use ActiveX.
  4. If IE8 and we're using one of get|post|head|put|delete|options, use the native XHR.

Am I right? Now it'd be nice to be able to do this without UA-sniffing.

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Nov 7, 2014

Member

Or we could just always use the native XHR for cross-domain requests; IE<10 don't have CORS anyway. But then some people might rely on cross-domain PATCH requests working via XDomainRequest if I understand it correctly.

Member

mgol commented Nov 7, 2014

Or we could just always use the native XHR for cross-domain requests; IE<10 don't have CORS anyway. But then some people might rely on cross-domain PATCH requests working via XDomainRequest if I understand it correctly.

@tomchentw

This comment has been minimized.

Show comment
Hide comment
@tomchentw

tomchentw Nov 8, 2014

(IE11/Win8.1/ModernIE) shows the same error, too.

(IE11/Win8.1/ModernIE) shows the same error, too.

@dmethvin

This comment has been minimized.

Show comment
Hide comment
@dmethvin

dmethvin Nov 11, 2014

Member

Sorry but this has gone around a bit and I want to be sure I understand where it stands. Are these two comments from mzgol a correct summary?

Member

dmethvin commented Nov 11, 2014

Sorry but this has gone around a bit and I want to be sure I understand where it stands. Are these two comments from mzgol a correct summary?

@dmethvin dmethvin added the Needs info label Nov 26, 2014

@dmethvin

This comment has been minimized.

Show comment
Hide comment
@dmethvin

dmethvin Nov 26, 2014

Member

@tomchentw can you summarize the current state of this issue and let us know whether it still exists?

Member

dmethvin commented Nov 26, 2014

@tomchentw can you summarize the current state of this issue and let us know whether it still exists?

@dmethvin

This comment has been minimized.

Show comment
Hide comment
@dmethvin

dmethvin Dec 5, 2014

Member

Let us know if this problem still exists and we can reopen.

Member

dmethvin commented Dec 5, 2014

Let us know if this problem still exists and we can reopen.

@dmethvin dmethvin closed this Dec 5, 2014

@tomchentw

This comment has been minimized.

Show comment
Hide comment
@tomchentw

tomchentw Dec 5, 2014

@dmethvin I already updated the first post, and I believe it's clear enough? Repost here:


Hey guys, not sure if it's proper to submit issue here. This is really an edge case to reproduce.

Prerequest

  1. Using jQuery 1.x
  2. HTTP method is PATCH
  3. It's a cross-origin request
  4. With browser IE10/11

Some setup

Thanks to http://httpbin.org/, it's relative easy to reproduce on jsfiddle.
However, since we're requiring CORS but this PR (requests/httpbin#158) is not merged && deployed, I forked and setup server thanks to Heroku: http://http-patch-cors.herokuapp.com/

Reproduce

Please visit this jsfiddle with IE10/11:
http://jsbin.com/qefabu/1/edit

IE10-Win7-JSBin

ie10-win7-jsbin

As you can see, it will error when I tested with virtual box VM from https://www.modern.ie/ (can any one confirm this issue exists in native windows?). But if you open the link with Chrome/Firefox/Safari, it works like a charm.

However, same code setup for jQuery 2 works fine across IE10/11/Chrome/Firefox/Safari:
http://jsfiddle.net/tomchentw/meyh6nkw/

Possible cause

As I dug into the code, I found there's some differences in creating xhr object between 1.x and 2.x code:
1.x: http://git.io/h5Fh2A
2.x: http://git.io/6ZpGEA

Because we're using patch method and it's absence in the regex, the statement will use the old window.ActiveXObject( "Microsoft.XMLHTTP" ) and maybe it doesn't support patch method?

@dmethvin I already updated the first post, and I believe it's clear enough? Repost here:


Hey guys, not sure if it's proper to submit issue here. This is really an edge case to reproduce.

Prerequest

  1. Using jQuery 1.x
  2. HTTP method is PATCH
  3. It's a cross-origin request
  4. With browser IE10/11

Some setup

Thanks to http://httpbin.org/, it's relative easy to reproduce on jsfiddle.
However, since we're requiring CORS but this PR (requests/httpbin#158) is not merged && deployed, I forked and setup server thanks to Heroku: http://http-patch-cors.herokuapp.com/

Reproduce

Please visit this jsfiddle with IE10/11:
http://jsbin.com/qefabu/1/edit

IE10-Win7-JSBin

ie10-win7-jsbin

As you can see, it will error when I tested with virtual box VM from https://www.modern.ie/ (can any one confirm this issue exists in native windows?). But if you open the link with Chrome/Firefox/Safari, it works like a charm.

However, same code setup for jQuery 2 works fine across IE10/11/Chrome/Firefox/Safari:
http://jsfiddle.net/tomchentw/meyh6nkw/

Possible cause

As I dug into the code, I found there's some differences in creating xhr object between 1.x and 2.x code:
1.x: http://git.io/h5Fh2A
2.x: http://git.io/6ZpGEA

Because we're using patch method and it's absence in the regex, the statement will use the old window.ActiveXObject( "Microsoft.XMLHTTP" ) and maybe it doesn't support patch method?

@mgol mgol reopened this Dec 5, 2014

@dmethvin dmethvin changed the title from [jQuery 1.x] CORS HTTP patch request is not working on IE10/11 to CORS HTTP patch request is not working on IE10/11 Dec 30, 2014

@mgol mgol self-assigned this Jan 5, 2015

@mgol mgol added this to the 3.0.0 milestone Jan 5, 2015

mgol added a commit to mgol/jquery that referenced this issue Mar 30, 2015

Ajax: Use the native XHR for all non-local requests in IE9+
IE throws an error on cross-domain PATCH requests if issued via the ActiveX
interface. This commit switches the logic to use the native XHR in all
non-local requests.

Fixes gh-1684
@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Mar 30, 2015

Member

@tomchentw Could you check if this works for you with https://dl.dropboxusercontent.com/u/10200888/jquery/jquery-cors.js? I submitted a PR with such a patch: #2183.

Member

mgol commented Mar 30, 2015

@tomchentw Could you check if this works for you with https://dl.dropboxusercontent.com/u/10200888/jquery/jquery-cors.js? I submitted a PR with such a patch: #2183.

mgol added a commit to mgol/jquery that referenced this issue Mar 30, 2015

Ajax: Use the native XHR for all non-local requests in IE9+
IE throws an error on cross-domain PATCH requests if issued via the ActiveX
interface. This commit switches the logic to use the native XHR in all
non-local requests.

Fixes gh-1684

mgol added a commit to mgol/jquery that referenced this issue Mar 30, 2015

Ajax: Use the native XHR for all non-local requests in IE9+
IE throws an error on cross-domain PATCH requests if issued via the ActiveX
interface. This commit switches the logic to use the native XHR in all
non-local requests.

Fixes gh-1684
@tomchentw

This comment has been minimized.

Show comment
Hide comment
@tomchentw

tomchentw Apr 7, 2015

Currently don't have an IE environment to test with...

Currently don't have an IE environment to test with...

mgol added a commit to mgol/jquery that referenced this issue Apr 7, 2015

Ajax: Use the native XHR for all non-local requests in IE9+
IE throws an error on cross-domain PATCH requests if issued via the ActiveX
interface. This commit switches the logic to use the native XHR in all
non-local requests.

Fixes gh-1684
Closes gh-2183
@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Apr 26, 2015

Member

jsFiddle broke jQuery Edge URLs; apparently jQuery Compat Edge & jQuery Edge are swapped. :/ See jsfiddle/jsfiddle-issues#600

It's better to use jsbin now: http://jsbin.com/lipaxe/2

EDIT: jsFiddle has been fixed.

Member

mgol commented Apr 26, 2015

jsFiddle broke jQuery Edge URLs; apparently jQuery Compat Edge & jQuery Edge are swapped. :/ See jsfiddle/jsfiddle-issues#600

It's better to use jsbin now: http://jsbin.com/lipaxe/2

EDIT: jsFiddle has been fixed.

mgol added a commit to mgol/jquery that referenced this issue Apr 26, 2015

Ajax: Use the native XHR for all non-local requests in IE9+
IE throws an error on cross-domain PATCH requests if issued via the ActiveX
interface. This commit switches the logic to use the native XHR in all
non-local requests.

Fixes gh-1684
Closes gh-2183

mgol added a commit to mgol/jquery that referenced this issue Apr 26, 2015

Ajax: Use the native XHR for all non-local requests in IE9+
IE throws an error on cross-domain PATCH requests if issued via the ActiveX
interface. This commit switches the logic to use the native XHR in all
non-local requests.

Fixes gh-1684
Closes gh-2183

mgol added a commit to mgol/jquery that referenced this issue Apr 26, 2015

Ajax: Use the native XHR for all non-local requests in IE9+
IE throws an error on cross-domain PATCH requests if issued via the ActiveX
interface. This commit switches the logic to use the native XHR in all
non-local requests.

Fixes gh-1684
Closes gh-2183

mgol added a commit to mgol/jquery that referenced this issue Apr 26, 2015

Ajax: Use the native XHR for all non-local requests in IE9+
IE throws an error on cross-domain PATCH requests if issued via the ActiveX
interface. This commit switches the logic to use the native XHR in all
non-local requests.

Fixes gh-1684
Closes gh-2183

mgol added a commit to mgol/jquery that referenced this issue May 11, 2015

Ajax: Use the native XHR for all non-local requests in IE9+
IE throws an error on cross-domain PATCH requests if issued via the ActiveX
interface. This commit switches the logic to use the native XHR in all
non-local requests.

Fixes gh-1684
Closes gh-2183

mgol added a commit to mgol/jquery that referenced this issue May 11, 2015

Ajax: Use the native XHR for all non-local requests in IE9+
IE throws an error on cross-domain PATCH requests if issued via the ActiveX
interface. This commit switches the logic to use the native XHR in all
non-local requests.

Fixes gh-1684
Closes gh-2183

mgol added a commit that referenced this issue May 18, 2015

Ajax: Use the native XHR for all non-local requests in IE9+
IE throws an error on cross-domain PATCH requests if issued via the ActiveX
interface. This commit switches the logic to use the native XHR in all
non-local requests.

Fixes gh-1684
Closes gh-2183
@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol May 18, 2015

Member

Closed via #2183, laded at 61f812b.

Member

mgol commented May 18, 2015

Closed via #2183, laded at 61f812b.

@mgol mgol closed this May 18, 2015

@mgol mgol removed the Has Pull Request label Nov 9, 2015

@dmethvin dmethvin modified the milestones: 1.12/2.2, 3.0.0 Jan 7, 2016

@cssmagic cssmagic referenced this issue May 18, 2016

Open

jQuery #5

Kuzirashi added a commit to Kuzirashi/jquery that referenced this issue Oct 7, 2016

Ajax: Use the native XHR for all non-local requests in IE8+
IE throws an error on cross-domain PATCH requests if issued via the ActiveX
interface. This commit switches the logic to use the native XHR in all
non-local requests.

Fixes gh-1684
Closes gh-2183

@lock lock bot locked as resolved and limited conversation to collaborators Jun 19, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.