Beacon requests with BufferSource payload should not have a Content-Type HTTP header.
<rdar://problem/34748470>
Created attachment 323043 [details] Patch
--- /Volumes/Data/cdumez/WebKit/OpenSource/WebKitBuild/Debug/layout-test-results/imported/w3c/web-platform-tests/beacon/headers/header-content-type-expected.txt +++ /Volumes/Data/cdumez/WebKit/OpenSource/WebKitBuild/Debug/layout-test-results/imported/w3c/web-platform-tests/beacon/headers/header-content-type-actual.txt @@ -1,7 +1,7 @@ PASS Test content-type header for a body string -FAIL Test content-type header for a body ArrayBufferView assert_equals: Correct Content-Type header result expected "" but got "application/x-www-form-urlencoded" -FAIL Test content-type header for a body ArrayBuffer assert_equals: Correct Content-Type header result expected "" but got "application/x-www-form-urlencoded" +PASS Test content-type header for a body ArrayBufferView +PASS Test content-type header for a body ArrayBuffer PASS Test content-type header for a body Blob PASS Test content-type header for a body FormData PASS Test content-type header for a body URLSearchParams
--- /Volumes/Data/cdumez/WebKit/OpenSource/WebKitBuild/Debug/layout-test-results/http/tests/blink/sendbeacon/beacon-same-origin-expected.txt +++ /Volumes/Data/cdumez/WebKit/OpenSource/WebKitBuild/Debug/layout-test-results/http/tests/blink/sendbeacon/beacon-same-origin-actual.txt @@ -16,12 +16,11 @@ Sending beacon with type: [object Uint32Array] PASS navigator.sendBeacon("resources/save-beacon.php?name=same-origin", payload); is true PASS Beacon sent successfully -PASS Content-Type: application/x-www-form-urlencoded PASS Origin: http://127.0.0.1:8000 PASS Referer: http://127.0.0.1:8000/blink/sendbeacon/beacon-same-origin.html PASS Request-Method: POST PASS Length: 40 -PASS Body: QAAAAEEAAABCAAAAQwAAAEQAAABFAAAARgAAAEcAAABIAAAASQAAAA== +PASS Body: @\0\0\0A\0\0\0B\0\0\0C\0\0\0D\0\0\0E\0\0\0F\0\0\0G\0\0\0H\0\0\0I PASS Sending beacon with type: [object Blob] PASS navigator.sendBeacon("resources/save-beacon.php?name=same-origin", payload); is true
Created attachment 323045 [details] Patch
Comment on attachment 323045 [details] Patch Clearing flags on attachment: 323045 Committed r223014: <http://trac.webkit.org/changeset/223014>
All reviewed patches have been landed. Closing bug.
(In reply to WebKit Commit Bot from comment #6) > Comment on attachment 323045 [details] > Patch > > Clearing flags on attachment: 323045 > > Committed r223014: <http://trac.webkit.org/changeset/223014> This broke several of the Internal SDK builds, since -_suppressedAutoAddedHTTPHeaders isn't defined in most macOS 10.13 and iOS 11 Internal SDKs, and CFNetworkSPI.h only defines it for Public SDK builds.
Tried to fix the build in r223019: <http://trac.webkit.org/changeset/223019>
(In reply to Andy Estes from comment #8) > and CFNetworkSPI.h only defines it for Public SDK builds. Oh, I did not know this. Thanks for fixing.