Issue metadata
Sign in to add a comment
|
Origin header not always being sent on XMLHttpRequest
Reported by
eszec...@gmail.com,
Jun 16 2016
|
||||||||||||||||||||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2769.0 Safari/537.36
Example URL:
n/a
Steps to reproduce the problem:
1. set up dummy service-worker (simple console.log as provided by default polymer project does it for me)
2. make an XMLHttpRequest from an html to another (allowed) domain(NOTE: The backend server returns the value provided in Origin header as an allowed origin only if it is in the list of allowed domains)
3. Request works up to here
4. Hit refresh
5. Header "Origin" is not sent in request and fails ("XMLHttpRequest cannot load https://api/list. The 'Access-Control-Allow-Origin' header")
If i unregister the service worker, it works again one time till i refresh.
My Service worker is empty for dev (using polymer) so it's code is only a "console.log".
The request is as simple as :
function(rq) {
var xhr = new XMLHttpRequest();
xhr.addEventListener('load', rq.onLoad.bind(this));
xhr.open('GET', rq.url);
xhr.setRequestHeader("Accept","application/json");
xhr.setRequestHeader("Accept-Language","en-US");
xhr.send();
}
What is the expected behavior?
I think that on step (5) the request should have sent the "Origin" header
The exact same page works OK in the current stable version of chrome., but fails on this canary release.
What went wrong?
Header "Origin" was not sent in the request.
Did this work before? Yes Current stable Chrome version works ok.
Chrome version: 53.0.2769.0 Channel: canary
OS Version: OS X 10.11.0
Flash Version: Shockwave Flash 22.0 r0
,
Jun 16 2016
The version where the problem does not occur is: Version 51.0.2704.84 (64-bit)
,
Jun 16 2016
For some reason, the comment body has been deleted, but I just added SW label.
,
Jun 16 2016
Sorry, I might delete the message by mistake when I looked via my smartphone... # I think the position of "Delete comment" is quite good to touch for scrolling;(
,
Jun 17 2016
,
Jun 21 2016
Attached is a simple example (html + empty sw) where you can reproduce the issue: 1) load html and click test. you'll see that request sends "Origin" correctly. 2) hit refresh and click "test" again. You'll see that request is not sending "Origin" header. Additionally, if you go to Dev tools -> "Application" -> "Clear Storage" -> Clear all. Then hit refresh and It works again.
,
Jun 22 2016
Don't you see "Provisional headers are shown" on the "Request Headers" block you're looking at?
,
Jun 22 2016
No, attached are screenshots of the header block for both requests
,
Jun 23 2016
I mean r400928. shimazu@, please check if your patch introduces this when you try to reland it.
,
Jun 23 2016
I guess this is caused by the same reason of http://crbug.com/621788 . This will be probably fixed when it's relanded. Sorry for the inconvenience ;(
,
Jun 24 2016
Hi guys, I checked the latest version: Google Chrome 53.0.2777.0 (Official Build) canary (64-bit) Revision cd5f1c60daa702f416e719edf13358571e0bf084-refs/heads/master@{#401526} And i can no longer reproduce the issue now
,
Jun 24 2016
Thanks for the followup! Marking this as a duplicate of the fixed issue. |
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by xunji...@chromium.org
, Jun 16 2016Labels: -Type-Bug Needs-Bisect Type-Bug-Regression