Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}).then(xhr => {
const responseBody =
xhr.status === 204 && xhr.responseText === '' ? null : xhr.responseText;
return new Response(responseBody, {
status: xhr.status,
statusText: xhr.statusText,
headers: XHRUtils.serializeResponseHeaders(xhr.getAllResponseHeaders())
});
});
}