You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have an API that responds with 201s and 204s which have a null response body. This results in the following error:
TypeError: Failed to construct 'Response': Response with null body status cannot have body
at fetch-robot.js:1363
This is the code:
function deserializeResponse(response) {
return response.text().then(function(text) {
return new window.Response(text, {
status: response.status,
statusText: response.statusText,
headers: deserializeHeaders(response.headers)
});
});
}
Should be a simple fix to construct the object and only add the statusText if it is not null.
I tried to fork the project so that I could submit a PR to fix this but could not get it to build or run tests with the dependencies that were installed unfortunately.
The text was updated successfully, but these errors were encountered:
We have an API that responds with 201s and 204s which have a null response body. This results in the following error:
TypeError: Failed to construct 'Response': Response with null body status cannot have body
at fetch-robot.js:1363
This is the code:
Should be a simple fix to construct the object and only add the statusText if it is not null.
I tried to fork the project so that I could submit a PR to fix this but could not get it to build or run tests with the dependencies that were installed unfortunately.
The text was updated successfully, but these errors were encountered: