Open Bug 1469359 Opened 7 years ago Updated 7 months ago

Support ReadableStream as Request.body in fetch API in necko

Categories

(Core :: Networking, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: baku, Unassigned)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [necko-triaged])

Fetch API supports ReadableStreams only in Response.body. In order to support them in Request.body, we need to allow the sending of nsIAsyncInputStream as content body in HTTP/2 without knowing its length.
Note: though comment 0 may imply otherwise, I do not believe this is strictly http/2-specific, as it just reads the body from the transaction through the usual ReadSegments stuff, which at the h2 layer doesn't care about length of the stream. This likely lives in the transaction.
Priority: -- → P3
Whiteboard: [necko-triaged]
Andrew: do you have idea what priority this should be, or know who would? (It sounds from bug 1491740 comment 0 that Chrome has this working already, FWIW). Do we have any sort of existing roadmap or bug priority queue for fetch stuff?
Flags: needinfo?(overholt)
(the other) Jason's trying to ship Readable Streams over in bug 1385890. I don't know about the priority around Request.body (https://fetch.spec.whatwg.org/#body). Anne, do you have an opinion on the priority of Request.body as a ReadableStream?
Flags: needinfo?(overholt) → needinfo?(annevk)
This isn't shipped by anyone yet and there remain some open issues (and I think a general lack of good tests for the corner cases). Response streams are important, but this can wait (though I'd expect sorting out the details and shipping this would buy us some developer goodwill and push everyone else to get to it).
Flags: needinfo?(annevk)
Severity: normal → S3

In order to support them in Request.body, we need to allow the sending of nsIAsyncInputStream as content body in HTTP/2 without knowing its length.

Hi Randell, do you know whether it's a solved problem now, given we have WebTransportSendStream?

Flags: needinfo?(rjesup)

Perhaps. From comment 1 it's not h2-specific. I didn't do anything special that would impact this, but maybe this can build on what was done for WT.

Flags: needinfo?(rjesup)

Hi! We ran into a problem on the project: To upload large files from the frontend, we use ReadableStream, everything works well in Chrome, we debugged it there and rolled it out to the prod, but later it was noticed that upload simply does not work in Firefox and immediately interrupts the stream. Is there currently no way to insert a Readable Stream into the request body (we use h2) ?

Flags: needinfo?(amarchesini)

Dmitrii, can you please file a separate bug, including an STR or anything useful to reproduce the issue? Thank you!

Flags: needinfo?(amarchesini) → needinfo?(ponomarevdima047)

(In reply to Andrea Marchesini [:baku] from comment #9)

Dmitrii, can you please file a separate bug, including an STR or anything useful to reproduce the issue? Thank you!

Hi, I'm facing the same problem https://bugzilla.mozilla.org/show_bug.cgi?id=1911164
The response says that it is in the plans, but it is not working at the moment, and it is not known when it will be implemented.

Flags: needinfo?(ponomarevdima047)
You need to log in before you can comment on or make changes to this bug.