Skip to content

Commit

Permalink
Introduce RequestInit.duplex
Browse files Browse the repository at this point in the history
This implements whatwg/fetch#1457.

Bug: 1337696
Change-Id: I3fcf6f484dc922f5a875ed658adad33631d55115
  • Loading branch information
yutakahirano authored and chromium-wpt-export-bot committed Jul 4, 2022
1 parent 951f968 commit 2c13d48
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fetch/api/basic/request-upload.h2.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,15 @@ promise_test(async (test) => {
const request = new Request('', {
body: new ReadableStream(),
method: 'POST',
duplex,
});

assert_equals(request.headers.get('Content-Type'), null, `Request should not have a content-type set`);

const response = await fetch('data:a/a;charset=utf-8,test', {
method: 'POST',
body: new ReadableStream(),
duplex,
});

assert_equals(await response.text(), 'test', `Response has correct body`);
Expand All @@ -75,6 +77,7 @@ promise_test(async (test) => {
const request = new Request('data:a/a;charset=utf-8,test', {
body: new ReadableStream(),
method: 'POST',
duplex,
});

assert_equals(request.headers.get('Content-Type'), null, `Request should not have a content-type set`);
Expand Down

0 comments on commit 2c13d48

Please sign in to comment.