Bug 171489 - Response.blob() has empty type when created with a ReadableStream and content-type header
Summary: Response.blob() has empty type when created with a ReadableStream and content...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-30 19:31 PDT by Ben Kelly
Modified: 2017-05-02 09:58 PDT (History)
5 users (show)

See Also:


Attachments
Set Response.blob() type correctly when body is a ReadableStream. (4.06 KB, patch)
2017-04-30 19:44 PDT, Ben Kelly
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Kelly 2017-04-30 19:31:33 PDT
WebKit is currently failing this WPT test:

fetch/api/response/response-consume.html

On the "from stream to blob" case.

This test is basically:


  var data = 'hello world';

  var stream = new ReadableStream({
    start: function(controller) {
      controller.enqueue(stringToArray(data));
      controller.close();
    }
  });

  var r = new Response(stream, { headers: [['content-type', 'text/plain']] });

  r.blob().then(b => assert_equals(b.type, 'text/plain'));

WebKit is failing because whenever a ReadableStream is passed as the body of the Response the blob() output will have an empty string Blob.type.
Comment 1 Ben Kelly 2017-04-30 19:44:43 PDT
Created attachment 308708 [details]
Set Response.blob() type correctly when body is a ReadableStream.
Comment 2 youenn fablet 2017-05-02 09:29:45 PDT
Comment on attachment 308708 [details]
Set Response.blob() type correctly when body is a ReadableStream.

Thanks!
Comment 3 WebKit Commit Bot 2017-05-02 09:58:37 PDT
Comment on attachment 308708 [details]
Set Response.blob() type correctly when body is a ReadableStream.

Clearing flags on attachment: 308708

Committed r216073: <http://trac.webkit.org/changeset/216073>
Comment 4 WebKit Commit Bot 2017-05-02 09:58:38 PDT
All reviewed patches have been landed.  Closing bug.