mirror of
https://github.com/gchq/CyberChef
synced 2025-12-05 23:53:27 +00:00
Added error handling for non-CORS requests.
This commit is contained in:
@@ -126,6 +126,10 @@ const HTTP = {
|
||||
|
||||
return fetch(url, config)
|
||||
.then(r => {
|
||||
if (r.status === 0 && r.type === "opaque") {
|
||||
return "Error: Null response. Try setting the connection mode to CORS.";
|
||||
}
|
||||
|
||||
if (showResponseMetadata) {
|
||||
let headers = "";
|
||||
for (let pair of r.headers.entries()) {
|
||||
|
||||
Reference in New Issue
Block a user