NetworkCORSPreflightChecker should set the preflight request User-Agent header
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Jun 2018 17:21:17 +0000 (17:21 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Jun 2018 17:21:17 +0000 (17:21 +0000)
commitc0c756297d7ce44e1046a1bbea2d1052cd849557
treea8d67063db61bd907b6c72af66e1204824408e76
parentba9d16f46e4992dbc07ec7f777ee08f675196305
NetworkCORSPreflightChecker should set the preflight request User-Agent header
https://bugs.webkit.org/show_bug.cgi?id=186254
<rdar://problem/40293504>

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/cors/cors-preflight.any-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight.any.js:
(corsPreflight):
* web-platform-tests/fetch/api/cors/cors-preflight.any.worker-expected.txt:
* web-platform-tests/fetch/api/resources/preflight.py:
(main):

Source/WebKit:

Some servers misbehave if the User-Agent header is not set properly on preflight requests.
Set it to the same value as the request triggering the preflight.

* NetworkProcess/NetworkCORSPreflightChecker.cpp:
(WebKit::NetworkCORSPreflightChecker::startPreflight):
* NetworkProcess/NetworkCORSPreflightChecker.h:
* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232470 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight.any-expected.txt
LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight.any.js
LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight.any.worker-expected.txt
LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/preflight.py
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.cpp
Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.h
Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp