mirror of
https://codeberg.org/vlw/monkeydo.git
synced 2025-09-13 15:53:40 +02:00
Fix Content-Type
test false negative
Some servers will append extra stuff (like encoding) to the `Content-Type` response header. This fixes that
This commit is contained in:
parent
b2556f1ced
commit
4073785f93
1 changed files with 1 additions and 1 deletions
|
@ -64,7 +64,7 @@ export default class Monkeydo extends MonkeyWorker {
|
|||
const fetchManifest = await fetch(manifest);
|
||||
|
||||
// If the URL parsed but the fetch response is invalid, give up and throw an error
|
||||
if(!fetchManifest.ok || fetchManifest.headers.get("Content-Type") !== "application/json") {
|
||||
if(!fetchManifest.ok || !fetchManifest.headers.get("Content-Type")?.includes("application/json")) {
|
||||
throw new TypeError(errorPrefix + "Invalid response Content-Type or HTTP status");
|
||||
}
|
||||
data = await fetchManifest.json();
|
||||
|
|
Loading…
Add table
Reference in a new issue