From 09b33ef3fa4ddcbf467fad0409a0d8c2bf3ecb87 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Fri, 18 Feb 2022 12:04:00 +1300 Subject: [PATCH] Allow viewing webp files --- src/site/api/proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/site/api/proxy.js b/src/site/api/proxy.js index 7273c89..b8156a9 100644 --- a/src/site/api/proxy.js +++ b/src/site/api/proxy.js @@ -52,7 +52,7 @@ module.exports = [ route: "/imageproxy", methods: ["GET"], code: async (input) => { const verifyResult = verifyURL(input.url) if (verifyResult.status !== "ok") return verifyResult.value - if (!["png", "jpg"].some(ext => verifyResult.url.pathname.endsWith(ext))) return [400, "URL extension is not allowed"] + if (!["png", "jpg", "webp"].some(ext => verifyResult.url.pathname.endsWith(ext))) return [400, "URL extension is not allowed"] const params = input.url.searchParams const width = +params.get("width") if (typeof width === "number" && !isNaN(width) && width > 0) {