Skip to content
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
Closed

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

tomchentw opened this issue Oct 8, 2014 · 27 comments

Comments

@tomchentw
Copy link

See #1684 (comment) for latest update.

@dmethvin
Copy link
Member

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

@mgol
Copy link
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
Copy link
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
Copy link
Author

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

@mgol
Copy link
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
Copy link
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
Copy link
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
Copy link
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
Copy link
Member

markelog commented Nov 7, 2014

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

@tomchentw
Copy link
Author

@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
Copy link
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
Copy link
Member

mgol commented Nov 7, 2014

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

@mgol
Copy link
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
Copy link
Author

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
Copy link
Member

mgol commented Nov 7, 2014

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

@tomchentw
Copy link
Author

WOW! Great Open Source.

@mgol
Copy link
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
Copy link
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
Copy link
Author

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

@dmethvin
Copy link
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?

@dmethvin
Copy link
Member

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

@dmethvin
Copy link
Member

dmethvin commented Dec 5, 2014

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

@dmethvin dmethvin closed this as completed Dec 5, 2014
@tomchentw
Copy link
Author

@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 (https://github.com/kennethreitz/httpbin/pull/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 dmethvin added the Bug label Dec 30, 2014
@dmethvin dmethvin changed the title [jQuery 1.x] CORS HTTP patch request is not working on IE10/11 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
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 jquerygh-1684
@mgol
Copy link
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
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 jquerygh-1684
mgol added a commit to mgol/jquery that referenced this issue Mar 30, 2015
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 jquerygh-1684
@tomchentw
Copy link
Author

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

mgol added a commit to mgol/jquery that referenced this issue Apr 7, 2015
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 jquerygh-1684
Closes jquerygh-2183
@mgol
Copy link
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
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 jquerygh-1684
Closes jquerygh-2183
mgol added a commit to mgol/jquery that referenced this issue Apr 26, 2015
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 jquerygh-1684
Closes jquerygh-2183
mgol added a commit to mgol/jquery that referenced this issue Apr 26, 2015
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 jquerygh-1684
Closes jquerygh-2183
mgol added a commit to mgol/jquery that referenced this issue Apr 26, 2015
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 jquerygh-1684
Closes jquerygh-2183
mgol added a commit to mgol/jquery that referenced this issue May 11, 2015
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 jquerygh-1684
Closes jquerygh-2183
mgol added a commit to mgol/jquery that referenced this issue May 11, 2015
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 jquerygh-1684
Closes jquerygh-2183
mgol added a commit that referenced this issue May 18, 2015
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
Copy link
Member

mgol commented May 18, 2015

Closed via #2183, laded at 61f812b.

@mgol mgol closed this as completed May 18, 2015
@dmethvin dmethvin modified the milestones: 1.12/2.2, 3.0.0 Jan 7, 2016
e00dan pushed a commit to e00dan/jquery that referenced this issue Oct 7, 2016
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 jquerygh-1684
Closes jquerygh-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.
Development

No branches or pull requests

5 participants