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 e7f1bb6 commit 08a0381Copy full SHA for 08a0381
src/content/docs/rules/snippets/examples/rewrite-site-links.mdx
@@ -40,7 +40,13 @@ 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
const contentType = res.headers.get("Content-Type");
47
+ if (typeof contentType !== "string") {
48
49
50
51
// If the response is HTML, it can be transformed with
52
// HTMLRewriter -- otherwise, it should pass through
@@ -51,4 +57,4 @@ export default {
57
}
58
},
53
59
};
54
-```
60
+```
0 commit comments