Bug 175600 - Fetch / Beacon: Use "application/octet-stream" Content-Type for payloads of type ArrayBuffer / ArrayBufferView
Summary: Fetch / Beacon: Use "application/octet-stream" Content-Type for payloads of t...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-08-15 14:43 PDT by Chris Dumez
Modified: 2017-08-16 08:43 PDT (History)
6 users (show)

See Also:


Attachments
Patch (8.08 KB, patch)
2017-08-15 14:47 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (20.68 KB, patch)
2017-08-15 15:39 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (1020.50 KB, patch)
2017-08-15 16:01 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (21.36 KB, patch)
2017-08-15 17:41 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2017-08-15 14:43:10 PDT
Use "application/octet-stream" Content-Type for payloads of type ArrayBuffer / ArrayBufferView in Fetch & Beacon. If we don't set a Content-Type header, our underlying network stack is going to add a "application/x-www-form-urlencoded" Content-Type header, which is worse.
Comment 1 Chris Dumez 2017-08-15 14:47:56 PDT
Created attachment 318176 [details]
Patch
Comment 2 Chris Dumez 2017-08-15 15:39:50 PDT
Created attachment 318186 [details]
Patch
Comment 3 youenn fablet 2017-08-15 15:50:46 PDT
Comment on attachment 318186 [details]
Patch

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

> Source/WebCore/Modules/fetch/FetchBody.cpp:65
> +        contentType = HTTPHeaderValues::octetStreamContentType();

Can we add a FIXME stating that we should remove it once all WebKit network stacks support sending no CT?
Comment 4 Chris Dumez 2017-08-15 16:01:16 PDT
Created attachment 318188 [details]
Patch
Comment 5 youenn fablet 2017-08-15 16:17:04 PDT
Comment on attachment 318188 [details]
Patch

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

> Source/WebCore/Modules/fetch/FetchBody.cpp:65
> +        // FIXME: We should not set a Content-Type here but we need to do this until our network stack

s/our/all

> Source/WebCore/Modules/fetch/FetchBody.cpp:72
> +        // FIXME: We should not set a Content-Type here but we need to do this until our network stack

ditto

> LayoutTests/ChangeLog:13
> +2017-08-15  Chris Dumez  <cdumez@apple.com>

dup log and commit I guess
Comment 6 Chris Dumez 2017-08-15 17:41:39 PDT
Created attachment 318204 [details]
Patch
Comment 7 WebKit Commit Bot 2017-08-15 18:23:54 PDT
Comment on attachment 318204 [details]
Patch

Clearing flags on attachment: 318204

Committed r220779: <http://trac.webkit.org/changeset/220779>
Comment 8 WebKit Commit Bot 2017-08-15 18:23:55 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Radar WebKit Bug Importer 2017-08-15 18:25:30 PDT
<rdar://problem/33910024>
Comment 10 Fujii Hironori 2017-08-16 01:23:08 PDT
3 LayoutTests of iOS port fail:

http/tests/blink/sendbeacon/beacon-same-origin.html
http/wpt/beacon/cors/cors-preflight-arraybufferview-failure.html
http/wpt/beacon/cors/cors-preflight-arraybufferview-success.html

https://build.webkit.org/results/Apple%20iOS%2010%20Simulator%20Release%20WK2%20(Tests)/r220779%20(3641)/results.html
Comment 11 Ryan Haddad 2017-08-16 08:36:21 PDT
(In reply to Fujii Hironori from comment #10)
> 3 LayoutTests of iOS port fail:
> 
> http/tests/blink/sendbeacon/beacon-same-origin.html
> http/wpt/beacon/cors/cors-preflight-arraybufferview-failure.html
> http/wpt/beacon/cors/cors-preflight-arraybufferview-success.html
> 
> https://build.webkit.org/results/
> Apple%20iOS%2010%20Simulator%20Release%20WK2%20(Tests)/r220779%20(3641)/
> results.html
The same 3 are failing on Sierra:

https://build.webkit.org/results/Apple%20Sierra%20Release%20WK2%20(Tests)/r220795%20(3640)/results.html
Comment 12 Chris Dumez 2017-08-16 08:43:49 PDT
(In reply to Ryan Haddad from comment #11)
> (In reply to Fujii Hironori from comment #10)
> > 3 LayoutTests of iOS port fail:
> > 
> > http/tests/blink/sendbeacon/beacon-same-origin.html
> > http/wpt/beacon/cors/cors-preflight-arraybufferview-failure.html
> > http/wpt/beacon/cors/cors-preflight-arraybufferview-success.html
> > 
> > https://build.webkit.org/results/
> > Apple%20iOS%2010%20Simulator%20Release%20WK2%20(Tests)/r220779%20(3641)/
> > results.html
> The same 3 are failing on Sierra:
> 
> https://build.webkit.org/results/Apple%20Sierra%20Release%20WK2%20(Tests)/
> r220795%20(3640)/results.html

Follow-up landed in <http://trac.webkit.org/changeset/220796>.