Bug 224301

Summary: Add test to verify _WKCustomHeaderFields is used with HTTP requests
Product: WebKit Reporter: Alex Christensen <achristensen>
Component: New BugsAssignee: Alex Christensen <achristensen>
Status: NEW ---    
Severity: Normal CC: webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch youennf: review+

Description Alex Christensen 2021-04-07 12:44:06 PDT
Add test to verify _WKCustomHeaderFields is used with HTTP requests
Comment 1 Alex Christensen 2021-04-07 12:44:43 PDT
Created attachment 425428 [details]
Patch
Comment 2 Alex Christensen 2021-04-07 14:18:43 PDT
Created attachment 425438 [details]
Patch
Comment 3 Alex Christensen 2021-04-07 16:18:33 PDT
Created attachment 425449 [details]
Patch
Comment 4 youenn fablet 2021-04-12 07:55:26 PDT
Comment on attachment 425449 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=425449&action=review

> Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:1196
> +    NSString *string = [NSString stringWithFormat:@"<script>function bodyloaded(){fetch('%@',{mode:'no-cors'}).then(()=>{alert('loaded')}).catch((e)=>{alert('caught '+e)})}</script><body onload='bodyloaded()'/>", server.request().URL];

Would be interesting to do it with CORS so that:
- injecting this custom header does not trigger preflight requests for all CORS requests
- ensuring preflight requests get that header
Comment 5 Radar WebKit Bug Importer 2021-04-14 12:46:28 PDT
<rdar://problem/76660315>