Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@ export default {
.on("img", new AttributeRewriter("src"));

const res = await fetch(request);
if (!res.headers.has("Content-Type")) {
return res;
}

const contentType = res.headers.get("Content-Type");
if (typeof contentType !== "string") {
return res;
}

// If the response is HTML, it can be transformed with
// HTMLRewriter -- otherwise, it should pass through
Expand All @@ -51,4 +58,4 @@ export default {
}
},
};
```
```
Loading