Updated http service to not read 204 response data
This commit is contained in:
parent
ea406690f5
commit
f3ee8f2d4c
|
@ -141,10 +141,14 @@ async function request(url, options = {}) {
|
||||||
/**
|
/**
|
||||||
* Get the content from a fetch response.
|
* Get the content from a fetch response.
|
||||||
* Checks the content-type header to determine the format.
|
* Checks the content-type header to determine the format.
|
||||||
* @param response
|
* @param {Response} response
|
||||||
* @returns {Promise<Object|String>}
|
* @returns {Promise<Object|String>}
|
||||||
*/
|
*/
|
||||||
async function getResponseContent(response) {
|
async function getResponseContent(response) {
|
||||||
|
if (response.status === 204) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const responseContentType = response.headers.get('Content-Type');
|
const responseContentType = response.headers.get('Content-Type');
|
||||||
const subType = responseContentType.split('/').pop();
|
const subType = responseContentType.split('/').pop();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue