Bug 177978 - Fetch fails to return response if response is received before full request body transmitted
Summary: Fetch fails to return response if response is received before full request bo...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: Safari 10
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-10-05 16:13 PDT by Niklas
Modified: 2017-10-09 16:39 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Niklas 2017-10-05 16:13:42 PDT
When doing a HTTP POST request with a request body using fetch(), it fails to return the server response if the response was received before the full request body was transmitted. 

For instance, I see this happening when sending (large) image/png data in body and using invalid credentials (Cookies), so the server in this case responds with a 401 before the full body is received. Safari treats it just like a dropped network call (TypeError), instead of returning the server response.
Comment 1 Radar WebKit Bug Importer 2017-10-09 12:53:47 PDT
<rdar://problem/34892875>
Comment 2 youenn fablet 2017-10-09 13:00:54 PDT
Hi Niklas.
Thanks for the report.

Are you seeing that only for 401?
Would you be able to test with normal responses like 200?

401 is usually handled internally hence why it might end up being covered to a TypeError.
Comment 3 Niklas 2017-10-09 16:39:00 PDT
Seems it happens regardless of HTTP response code. Tried with 200, 400, 401, 500 and they all result in a TypeError for the scenario described above.