mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-23 00:06:17 -04:00
Added error handling for non-CORS requests.
This commit is contained in:
parent
52426bc1a4
commit
127364e8a4
2 changed files with 5 additions and 1 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue