"Preflight request for request with keepalive specified is currently not supported" on same-origin fetch requests
Reported by
mfaust...@gmail.com,
Apr 23 2018
|
|||||||||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36
Steps to reproduce the problem:
Perform a fetch() call on the current origin with a custom header and keepalive enabled:
fetch('.', {headers: {'X-Test': '123'}, keepalive: true})
What is the expected behavior?
There should be no preflight required since the request is within the same-origin. With the keepalive set to false Chrome does not perform a preflight so it appears this check was added before it determines whether or not the request is CORS and requires a preflight.
What went wrong?
The fetch() call fails.
Did this work before? N/A
Does this work in other browsers? N/A
Chrome version: 66.0.3359.117 Channel: stable
OS Version: 10.0
Flash Version:
,
Apr 24 2018
Tested the issue on 66.0.3359.117 using Windows 10, Mac 10.13.3 with steps mentioned below. Pasted fetch('.', {headers: {'X-Test': '123'}, keepalive: true}) in devtools console and observed error as VM87:1 Preflight request for request with keepalive specified is currently not supported
(anonymous) @ VM87:1
PromiseĀ {<rejected>: TypeError: Failed to fetch
at <anonymous>:1:1}
VM87:1 Uncaught (in promise) TypeError: Failed to fetch
at <anonymous>:1:1
@Reporter: Could you please check the screenshot and let us know if this is the behavior you are seeing? If not please provide a sample URL or test file to test this issue.
Thanks!
,
Apr 24 2018
Yes, that is the behaviour being observed. I've also attached a test file that demonstrates the issue.
,
Apr 24 2018
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Apr 25 2018
Checked the issue on reported chrome version 66.0.3359.117 using Windows 10 with the below mentioned steps. 1. Launched chrome 2. Downloaded "fetch_keepalive_same-origin_no-cors.html" file provided in comment#3 and opened it in a new tab. 3. Opened DevTools It shows an error "Fetch API cannot load". Attaching the screen shot of the same. @Reporter: Could you please have a look at the screen shot and let us know if we have missed anything in the process. It would be highly helpful if confirmed on, whether the attached screen shot has an issue. Thanks!
,
Apr 25 2018
The sample needs to be hosted on a webserver, it cannot be served by the filesystem. The error message shown in the screenshot of comment #2 is the error message in question.
,
Apr 25 2018
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Apr 26 2018
Tested the issue on chrome reported version 66.0.3359.117 using Windows 10 with steps mentioned below: 1) Launched chrome reported version, created a local server 2) Dragged and dropped the file provided in comment#3 and opened Devtools, seen the same error as mentioned in comment#5 screenshot @Reporter: Please find the attached screencast for your reference and let us know if we missed anything in reproducing the issue, provide your feedback on it which help in further triaging it. Thanks!
,
Apr 26 2018
fetch('.', {headers: {'X-Test': '123'}, keepalive: true}) can cause preflight due to redirect. It may be reasonable to relax the restriction for requests with mode: 'same-origin'.
,
Apr 26 2018
,
Apr 26 2018
You are still running the script from a file:// schema instead of an http:// or https:// as the error message in your video demonstrates. You need to host the example file on an actual web server such that you navigate to it via something like: http://localhost/fetch_keepalive_same-origin_no-cors.html If the URL bar in the browser shows file:// then you won't be able to reproduce the issue in this bug. To move things along I've created a jsfiddle to demonstrate the bug in this issue: https://jsfiddle.net/pv8up9gd/
,
Apr 27 2018
|
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by susan.boorgula@chromium.org
, Apr 23 2018