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.
<rdar://problem/34892875>
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.
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.