aboutsummaryrefslogtreecommitdiff
path: root/examples/openInEditor.js
diff options
context:
space:
mode:
Diffstat (limited to 'examples/openInEditor.js')
-rw-r--r--examples/openInEditor.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/openInEditor.js b/examples/openInEditor.js
index 3c67f02c2..30992d958 100644
--- a/examples/openInEditor.js
+++ b/examples/openInEditor.js
@@ -3,7 +3,8 @@ import { parse } from "querystring";
export default {
fetch(req) {
- if (req.url === "/favicon.ico") return new Response("nooo dont open favicon in editor", { status: 404 });
+ const url = new URL(req.url);
+ if (url.pathname === "/favicon.ico") return new Response("nooo dont open favicon in editor", { status: 404 });
var pathname = req.url.substring(1);
const q = pathname.indexOf("?");