Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upCauses issue with Access-Control-Allow-Origin:* #49
Comments
This comment has been minimized.
This comment has been minimized.
|
Wow, what an interesting bug! Both http://yeoman-generator-list.herokuapp.com/ and https://yeoman-generator-list.herokuapp.com/ send "Access-Control-Allow-Origin:*", so in theory CORS should allow http://yeoman.io to load either by XMLHttpRequest. But in reality:
And indeed, disabling the Heroku rule makes both work fine. The behavior is exactly the same in Firefox 26. My guess is that the browser tries to check cross origin request rules on XMLHttpRequest.send() per http://www.w3.org/TR/XMLHttpRequest/#cross-origin-request-event-rules and gets confused because the URL it's supposed to load never gets loaded. So it returns an error, which Chrome mistakes for a cross origin resource sharing failure. If that's the case, we need to detect when an HTTP XMLHttpRequest is opened, abort it, and then open and send a new XMLHttpRequest with the rewritten URL. :/ |
This comment has been minimized.
This comment has been minimized.
|
This also causes several analytics services to fail, e.g. mixpanel. |
This comment has been minimized.
This comment has been minimized.
riking
commented
Jul 16, 2014
|
Bump - this is causing issues with Discourse on a CDN. https://github.com/discourse/discourse Test case: http://forum.fazedores.com/ |
This comment has been minimized.
This comment has been minimized.
Akamaozu
commented
Jul 31, 2014
|
@diracdeltas Your explanation seems to hit the nail on the head. Was having trouble with xmlhttp not getting the access-control-allow-origin header I clearly set. Requesting from my custom domain worked perfectly but the Heroku domain resulted in CORS. I suspect its something to do with the redirect because that's the only thing that changed. |
This comment has been minimized.
This comment has been minimized.
emas80
commented
Nov 22, 2014
|
Hi, we are experiencing the same issue on our beta environment, with the Firefox version. On our beta environment, we don't have https enabled, so you are browsing in http and contacting our different services only in http. The front end is a Rails app hosted on Heroku, the assets are hosted on S3. CORS on S3 is correctly configured as for their guide. If I disable HTTPs everywhere it works perfectly. It's really weird because from the files hosted on S3, the javascripts are loaded, while the .css are blocked. Needless to say that all of them are hosted on S3 in the same bucket. Please note that on our production environment, where https is enabled for every service, everything works perfectly, and I can't see any single error, not even in Mixpanel javascript. |
This comment has been minimized.
This comment has been minimized.
|
From @diracdeltas' summary it sounds like the short-term fix might be to simply skip rewrites of XHRs for now. If the parent page is HTTPS, the XHR should already go to HTTPS or it will be blocked as active mixed content (https://community.qualys.com/blogs/securitylabs/2014/03/19/https-mixed-content-still-the-easiest-way-to-break-ssl). If the parent page is HTTP we aren't improving security a lot by rewriting the XHR. |
This comment has been minimized.
This comment has been minimized.
|
@emas80 While we're working on a fix, you may be able to fix the issue in your dev environment by changing your code to always contact the HTTPS version of s3, even if you are running in non-HTTPS dev environment. |
This comment has been minimized.
This comment has been minimized.
garrettr
commented
Nov 26, 2014
XHRs aren't the only type of request affected by this bug. For example, if you load the test case from #49 (comment), you can see that CORS errors are firing for web fonts (.woff and .ttf). This suggests an interaction between HTTPS everywhere and the CORS implementation in Firefox, I would expect the other content types listed on this page will have issues too. |
This comment has been minimized.
This comment has been minimized.
emas80
commented
Nov 26, 2014
|
OK thanks! On Tue, Nov 25, 2014 at 3:21 AM, jsha notifications@github.com wrote:
|
This comment has been minimized.
This comment has been minimized.
garrettr
commented
Nov 26, 2014
|
@cooperq pointed out that this bug is present in both Firefox and Chrome, so it's likely not implementation-specific, but is more likely, as Yan suggested in #49 (comment), something related to the spec. I was able to avoid the issue by returning early instead of rewriting the URLs that are failing due to CORS. Interestingly, I was able to determine (by setting breakpoints in the Firefox addon code) that Firefox attempts to rewrite the Fastly font URLs to use https, but the CORS error message refers to the original URL with http. |
MarcelGerber
referenced this issue
Mar 5, 2015
Closed
"Download Brackets without Extract" link blocked by HTTPS Everywhere on Firefox #138
This was referenced Mar 8, 2015
This comment has been minimized.
This comment has been minimized.
|
anne van kesteren says this Firefox bug might be relevant: https://bugzilla.mozilla.org/show_bug.cgi?id=881830 |
This comment has been minimized.
This comment has been minimized.
|
Bug in chrome: https://code.google.com/p/chromium/issues/detail?id=387198 |
This comment has been minimized.
This comment has been minimized.
|
https://bugzilla.mozilla.org/show_bug.cgi?id=881830#c12 seems like the right explanation here. When a subresource is redirected to HTTPS by HTTPS-E or HSTS, the browser says, "I have no CORS information for this new URL, so just block it." Did a quick test and this seems to be fixed in Chrome but not in Firefox. To repro, make sure you have the Heroku rule enabled in the dev version of HTTPS Everywhere Firefox, then do an XHR to |
jsha
referenced this issue
Mar 18, 2015
Closed
HTTPS-E rules seem to be ignored when url is in CSS #1175
SimonSapin
referenced this issue
Apr 5, 2015
Closed
FontAwsome not loading from Fastly on http://users.rust-lang.org/ #1365
This comment has been minimized.
This comment has been minimized.
SimonSapin
commented
Apr 5, 2015
|
That Firefox bug is marked as fixed in Firefox 38, but I can reproduce #1365 (which I think is a case of this bug) on Firefox Nightly 40.0a1 (2015-04-04) |
This comment has been minimized.
This comment has been minimized.
AnAkkk
commented
Apr 19, 2015
|
I still have the same issue with Firefox 39. |
fuglede
referenced this issue
Jun 1, 2015
Closed
Jyllands-posten.dk rule breaks poll on politiken.dk #1809
This was referenced Jun 18, 2015
This comment has been minimized.
This comment has been minimized.
AnAkkk
commented
Jul 21, 2015
|
Is there any progress on this? I can't enable https everywhere because I have this issue on one of the websites I often visit. |
This comment has been minimized.
This comment has been minimized.
|
No progress so far, I'm afraid. In the meantime, if you would like to use HTTPS Everywhere, you can disable the rules for the specific site that has problems using the icon menu. |
This comment has been minimized.
This comment has been minimized.
swrobel
commented
Dec 23, 2015
|
I get the same issue on http://js2.coffee using Firefox 43.0.2 & HTTPS-Everywhere 5.1.2 on a Mac. I do not have the same issue on Chrome 47 & HTTPS-Everywhere 2015.12.16. The Firefox console shows the following error:
Checking the headers of both http://code.ionicframework.com/ionicons/2.0.1/fonts/ionicons.woff?v=2.0.1 and https://code.ionicframework.com/ionicons/2.0.1/fonts/ionicons.woff?v=2.0.1 reveals that they include |
This comment has been minimized.
This comment has been minimized.
chojrak11
commented
Apr 8, 2016
|
I'm bumping this with problem on www.easyjet.com. The button "Check-in Online" doesn't work when HTTPS Everywhere is installed/enabled in Firefox. Version 46.0beta8, HTTPS Everwhere 5.1.6. The error message in Firefox console is:
|
jsha
referenced this issue
May 16, 2016
Closed
dylmye.me breaks - due to SRI integrity hash or Cloudflare? #4668
jeremyn
referenced this issue
Sep 3, 2016
Closed
League of Legends bilgewater event site broken #2354
This comment has been minimized.
This comment has been minimized.
mbergin
commented
Sep 8, 2016
|
Seeing this in 2016.9.1 in Chrome 52.0.2743.116 which breaks the flight search form: XMLHttpRequest cannot load https://www.easyjet.com/ejcms/cache15m/api/flights/search?AdminFeePerBookin…,NTE,NCE,TLS,AJA,BIA,FSC,CDG,ORY,SXF&MaxResults=4&PreferredOriginIatas=LGW. Credentials flag is 'true', but the 'Access-Control-Allow-Credentials' header is ''. It must be 'true' to allow credentials. Origin 'http://www.easyjet.com' is therefore not allowed access. |
This was referenced Sep 9, 2016
This comment has been minimized.
This comment has been minimized.
mayhemer
commented
Sep 29, 2016
|
Regarding Firefox, I filed a Mozilla bug to add an API to support HTTP->HTTPS redirects, that would not be blocked by CORS checks, invoked by an XPCOM API directly on http channels. I never got a feedback from Yan in our bugzilla, tho. Bumping here then, since the issue still exists. Please see https://bugzilla.mozilla.org/show_bug.cgi?id=1149250#c3 for suggested changes in Gecko and give a feedback here or there please. We want to move forward. Thanks. |
Bisaloo
referenced this issue
Oct 23, 2017
Closed
Script tags with `crossorigin="anonymous"` set are blocked in Firefox. #12579
This comment has been minimized.
This comment has been minimized.
herrernst
commented
Jan 15, 2018
|
This is now fixed in upcoming Firefox 59 with "upgradeToSecure", see https://bugzilla.mozilla.org/show_bug.cgi?id=1149250 Would be good if HTTPS Everywhere would use it in the future to reduce breakage |
Bisaloo
referenced this issue
Mar 12, 2018
Closed
radiotimes.com mistakes HTTPS Everywhere for an ad-blocker #14879
This comment has been minimized.
This comment has been minimized.
|
It seems like from https://bugzilla.mozilla.org/show_bug.cgi?id=1149250 and https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/webRequest/BlockingResponse that there is a new option in Firefox that allows some I think this is high priority, or at least, something I don't want to get lost. How should we track progress on implementing this? Should we make a new issue? Ping @Bisaloo @brainwane @gloomy-ghost @Hainish @J0WI @wonderchook . |
This comment has been minimized.
This comment has been minimized.
IIRC Chrome managed to fix the issue without forcing extensions to use a new option, so it is only broken with Firefox. |
This comment has been minimized.
This comment has been minimized.
|
@gloomy-ghost That seems to be true, for example, from issue #14117, http://shop.decatorevista.ro/ has working styling and no CORS console messages in Chrome, but has broken styling with CORS console messages in Firefox. I don't know what Chrome does or doesn't specifically allow, though. |
danielchatfield commentedJan 2, 2014
Browser: chrome
Example (
may be fixed soon thoughFixed by using https directly): http://yeoman.io/community-generators.htmlPage tries to load http://yeoman-generator-list.herokuapp.com/ which results in:
XMLHttpRequest cannot load http://yeoman-generator-list.herokuapp.com/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://yeoman.io' is therefore not allowed access..If the page requests the https version directly then it works.