mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-04-17 00:39:06 +08:00
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.
|
||||
* Checks the content-type header to determine the format.
|
||||
* @param response
|
||||
* @param {Response} response
|
||||
* @returns {Promise<Object|String>}
|
||||
*/
|
||||
async function getResponseContent(response) {
|
||||
if (response.status === 204) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const responseContentType = response.headers.get('Content-Type');
|
||||
const subType = responseContentType.split('/').pop();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user