I have two versions of an API I can toggle via a feature flag. (One that returns application/json
and another that returns application/octet-stream
)
When I enabled the feature flag to use the new application/octet-stream
There seems to be a small subset of users for the API where they received failed to fetch
. The users where the octet-stream API works and doesn't have the same browser versions and OS. The different users have same browser versions and operating system.
This is the request header I send for both API.
"headers": {
"accept": "*/*",
"accept-language": "en-US,en;q=0.9",
"authorization": "...",
"content-type": "application/json",
"sec-ch-ua": "\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\"", // They would be using Chrome and it might be v102
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "// I believe this would be Windows 10",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-site",
},
"referrer": "...",
"referrerPolicy": "no-referrer-when-downgrade",
"body": "...",
"method": "POST",
"mode": "cors",
"credentials": "include"
This is the error from the logs (its similar to errors where there's no connection but the server receives the request and the other APIs seem to be returning correctly based on the logs)
"error": {
"message": "Failed to fetch",
"name": "TypeError",
"stack": "TypeError: Failed to fetch\n (...the chunks it failed at)"
},
Does anyone know what could be causing this issue? Am I missing an request or response header like maybe changing accept-encoding? or is it maybe a corporate firewall?