Changeset 220779 in webkit
- Timestamp:
- Aug 15, 2017 6:23:50 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r220776 r220779 1 2017-08-15 Chris Dumez <cdumez@apple.com> 2 3 Fetch / Beacon: Use "application/octet-stream" Content-Type for payloads of type ArrayBuffer / ArrayBufferView 4 https://bugs.webkit.org/show_bug.cgi?id=175600 5 6 Reviewed by Youenn Fablet. 7 8 * http/wpt/fetch/fetch-request-arraybuffer-content-type-expected.txt: Added. 9 * http/wpt/fetch/fetch-request-arraybuffer-content-type.html: Added. 10 * platform/mac-highsierra/imported/w3c/web-platform-tests/fetch/api/basic/request-headers.any-expected.txt: 11 * platform/mac-highsierra/imported/w3c/web-platform-tests/fetch/api/basic/request-headers.any.worker-expected.txt: 12 1 13 2017-08-15 Matt Lewis <jlewis3@apple.com> 2 14 -
trunk/LayoutTests/imported/w3c/ChangeLog
r220772 r220779 1 2017-08-15 Chris Dumez <cdumez@apple.com> 2 3 Fetch / Beacon: Use "application/octet-stream" Content-Type for payloads of type ArrayBuffer / ArrayBufferView 4 https://bugs.webkit.org/show_bug.cgi?id=175600 5 6 Reviewed by Youenn Fablet. 7 8 * web-platform-tests/beacon/headers/header-content-type-expected.txt: 9 * web-platform-tests/fetch/api/basic/request-headers.any-expected.txt: 10 * web-platform-tests/fetch/api/basic/request-headers.any.worker-expected.txt: 11 1 12 2017-08-15 Chris Dumez <cdumez@apple.com> 2 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/beacon/headers/header-content-type-expected.txt
r220494 r220779 1 1 2 2 PASS Test content-type header for a body string 3 FAIL Test content-type header for a body ArrayBufferView assert_equals: Correct Content-Type header result expected "" but got "application/ x-www-form-urlencoded"4 FAIL Test content-type header for a body ArrayBuffer assert_equals: Correct Content-Type header result expected "" but got "application/ x-www-form-urlencoded"3 FAIL Test content-type header for a body ArrayBufferView assert_equals: Correct Content-Type header result expected "" but got "application/octet-stream" 4 FAIL Test content-type header for a body ArrayBuffer assert_equals: Correct Content-Type header result expected "" but got "application/octet-stream" 5 5 PASS Test content-type header for a body Blob 6 6 PASS Test content-type header for a body FormData -
trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers.any-expected.txt
r215515 r220779 9 9 PASS Fetch with POST with URLSearchParams body 10 10 FAIL Fetch with POST with Blob body assert_equals: Request should have header content-type: null expected (object) null but got (string) "" 11 FAIL Fetch with POST with ArrayBuffer body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/ x-www-form-urlencoded"12 FAIL Fetch with POST with Uint8Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/ x-www-form-urlencoded"13 FAIL Fetch with POST with Int8Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/ x-www-form-urlencoded"14 FAIL Fetch with POST with Float32Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/ x-www-form-urlencoded"15 FAIL Fetch with POST with Float64Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/ x-www-form-urlencoded"16 FAIL Fetch with POST with DataView body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/ x-www-form-urlencoded"11 FAIL Fetch with POST with ArrayBuffer body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/octet-stream" 12 FAIL Fetch with POST with Uint8Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/octet-stream" 13 FAIL Fetch with POST with Int8Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/octet-stream" 14 FAIL Fetch with POST with Float32Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/octet-stream" 15 FAIL Fetch with POST with Float64Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/octet-stream" 16 FAIL Fetch with POST with DataView body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/octet-stream" 17 17 PASS Fetch with POST with Blob body with mime type 18 18 FAIL Fetch with Chicken assert_equals: Request should have header content-length: null expected (object) null but got (string) "0" -
trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers.any.worker-expected.txt
r215515 r220779 9 9 PASS Fetch with POST with URLSearchParams body 10 10 FAIL Fetch with POST with Blob body assert_equals: Request should have header content-type: null expected (object) null but got (string) "" 11 FAIL Fetch with POST with ArrayBuffer body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/ x-www-form-urlencoded"12 FAIL Fetch with POST with Uint8Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/ x-www-form-urlencoded"13 FAIL Fetch with POST with Int8Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/ x-www-form-urlencoded"14 FAIL Fetch with POST with Float32Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/ x-www-form-urlencoded"15 FAIL Fetch with POST with Float64Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/ x-www-form-urlencoded"16 FAIL Fetch with POST with DataView body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/ x-www-form-urlencoded"11 FAIL Fetch with POST with ArrayBuffer body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/octet-stream" 12 FAIL Fetch with POST with Uint8Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/octet-stream" 13 FAIL Fetch with POST with Int8Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/octet-stream" 14 FAIL Fetch with POST with Float32Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/octet-stream" 15 FAIL Fetch with POST with Float64Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/octet-stream" 16 FAIL Fetch with POST with DataView body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/octet-stream" 17 17 PASS Fetch with POST with Blob body with mime type 18 18 FAIL Fetch with Chicken assert_equals: Request should have header content-length: null expected (object) null but got (string) "0" -
trunk/LayoutTests/platform/mac-highsierra/imported/w3c/web-platform-tests/fetch/api/basic/request-headers.any-expected.txt
r219523 r220779 8 8 PASS Fetch with POST with FormData body 9 9 PASS Fetch with POST with URLSearchParams body 10 PASS Fetch with POST with Blob body 11 FAIL Fetch with POST with ArrayBuffer body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/ x-www-form-urlencoded"12 FAIL Fetch with POST with Uint8Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/ x-www-form-urlencoded"13 FAIL Fetch with POST with Int8Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/ x-www-form-urlencoded"14 FAIL Fetch with POST with Float32Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/ x-www-form-urlencoded"15 FAIL Fetch with POST with Float64Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/ x-www-form-urlencoded"16 FAIL Fetch with POST with DataView body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/ x-www-form-urlencoded"10 FAIL Fetch with POST with Blob body assert_equals: Request should have header content-type: null expected (object) null but got (string) "" 11 FAIL Fetch with POST with ArrayBuffer body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/octet-stream" 12 FAIL Fetch with POST with Uint8Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/octet-stream" 13 FAIL Fetch with POST with Int8Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/octet-stream" 14 FAIL Fetch with POST with Float32Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/octet-stream" 15 FAIL Fetch with POST with Float64Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/octet-stream" 16 FAIL Fetch with POST with DataView body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/octet-stream" 17 17 PASS Fetch with POST with Blob body with mime type 18 18 FAIL Fetch with Chicken assert_equals: Request should have header content-length: null expected (object) null but got (string) "0" -
trunk/LayoutTests/platform/mac-highsierra/imported/w3c/web-platform-tests/fetch/api/basic/request-headers.any.worker-expected.txt
r219523 r220779 8 8 FAIL Fetch with POST with FormData body Can't find variable: FormData 9 9 PASS Fetch with POST with URLSearchParams body 10 PASS Fetch with POST with Blob body 11 FAIL Fetch with POST with ArrayBuffer body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/ x-www-form-urlencoded"12 FAIL Fetch with POST with Uint8Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/ x-www-form-urlencoded"13 FAIL Fetch with POST with Int8Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/ x-www-form-urlencoded"14 FAIL Fetch with POST with Float32Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/ x-www-form-urlencoded"15 FAIL Fetch with POST with Float64Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/ x-www-form-urlencoded"16 FAIL Fetch with POST with DataView body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/ x-www-form-urlencoded"10 FAIL Fetch with POST with Blob body assert_equals: Request should have header content-type: null expected (object) null but got (string) "" 11 FAIL Fetch with POST with ArrayBuffer body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/octet-stream" 12 FAIL Fetch with POST with Uint8Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/octet-stream" 13 FAIL Fetch with POST with Int8Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/octet-stream" 14 FAIL Fetch with POST with Float32Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/octet-stream" 15 FAIL Fetch with POST with Float64Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/octet-stream" 16 FAIL Fetch with POST with DataView body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/octet-stream" 17 17 PASS Fetch with POST with Blob body with mime type 18 18 FAIL Fetch with Chicken assert_equals: Request should have header content-length: null expected (object) null but got (string) "0" -
trunk/Source/WebCore/ChangeLog
r220778 r220779 1 2017-08-15 Chris Dumez <cdumez@apple.com> 2 3 Fetch / Beacon: Use "application/octet-stream" Content-Type for payloads of type ArrayBuffer / ArrayBufferView 4 https://bugs.webkit.org/show_bug.cgi?id=175600 5 6 Reviewed by Youenn Fablet. 7 8 Use "application/octet-stream" Content-Type for payloads of type ArrayBuffer / ArrayBufferView in Fetch & Beacon. 9 If we don't set a Content-Type header, our underlying network stack is going to add a "application/x-www-form-urlencoded" 10 Content-Type header, which is worse. 11 12 Chrome is already using "application/octet-stream" Content-Type in Beacon, but use no Content-Type in Fetch. 13 The Fetch/Beacon specification says we should have no Content-Type header in this case but this is unfortunately 14 not something we can support at the moment. Using "application/octet-stream" Content-Type for now seems like the 15 lesser evil. 16 17 Test: http/wpt/fetch/fetch-request-arraybuffer-content-type.html 18 19 * Modules/fetch/FetchBody.cpp: 20 (WebCore::FetchBody::extract): 21 * platform/network/HTTPHeaderValues.cpp: 22 (WebCore::HTTPHeaderValues::octetStreamContentType): 23 * platform/network/HTTPHeaderValues.h: 24 1 25 2017-08-15 Robin Morisset <rmorisset@apple.com> 2 26 -
trunk/Source/WebCore/Modules/fetch/FetchBody.cpp
r220279 r220779 63 63 if (WTF::holds_alternative<RefPtr<ArrayBuffer>>(value)) { 64 64 Ref<const ArrayBuffer> buffer = WTF::get<RefPtr<ArrayBuffer>>(value).releaseNonNull(); 65 // FIXME: We should not set a Content-Type here but we need to do this until all network stacks 66 // support sending no Content-Type header (<dar://problem/33906567). 67 contentType = HTTPHeaderValues::octetStreamContentType(); 65 68 return FetchBody(WTFMove(buffer)); 66 69 } 67 70 if (WTF::holds_alternative<RefPtr<ArrayBufferView>>(value)) { 68 71 Ref<const ArrayBufferView> buffer = WTF::get<RefPtr<ArrayBufferView>>(value).releaseNonNull(); 72 // FIXME: We should not set a Content-Type here but we need to do this until all network stacks 73 // support sending no Content-Type header (<dar://problem/33906567). 74 contentType = HTTPHeaderValues::octetStreamContentType(); 69 75 return FetchBody(WTFMove(buffer)); 70 76 } -
trunk/Source/WebCore/platform/network/HTTPHeaderValues.cpp
r216217 r220779 45 45 } 46 46 47 const String& octetStreamContentType() 48 { 49 static NeverDestroyed<const String> contentType(MAKE_STATIC_STRING_IMPL("application/octet-stream")); 50 return contentType; 51 } 52 47 53 const String& noCache() 48 54 { -
trunk/Source/WebCore/platform/network/HTTPHeaderValues.h
r207086 r220779 33 33 const String& textPlainContentType(); 34 34 const String& formURLEncodedContentType(); 35 const String& octetStreamContentType(); 35 36 const String& noCache(); 36 37 const String& maxAge0();
Note: See TracChangeset
for help on using the changeset viewer.