We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab9095e commit 37e3c09Copy full SHA for 37e3c09
src/content/docs/rules/snippets/examples/rewrite-site-links.mdx
@@ -40,7 +40,14 @@ export default {
40
.on("img", new AttributeRewriter("src"));
41
42
const res = await fetch(request);
43
+ if (!res.headers.has("Content-Type")) {
44
+ return res;
45
+ }
46
+
47
const contentType = res.headers.get("Content-Type");
48
+ if (typeof contentType !== "string") {
49
50
51
52
// If the response is HTML, it can be transformed with
53
// HTMLRewriter -- otherwise, it should pass through
@@ -51,4 +58,4 @@ export default {
58
}
59
},
60
};
54
-```
61
+```
0 commit comments