From 8e269df3c1c93d0f924e3409b396776f82c8ebe8 Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Sat, 6 Apr 2024 03:38:23 -0700 Subject: [PATCH] Oh wow, don't use the images.neopets.com asset proxy anymore either! MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Huh, I was writing up an API inventory doc to send to TNT, and was gonna explain why we proxy these assets… but turns out we don't need to anymore! Nice! This is a bit fragile if they ever change their headers, so I'll mention that in the doc, but for now, yeah sure let's save the planet some computational effort! --- app/javascript/wardrobe-2020/util.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/javascript/wardrobe-2020/util.js b/app/javascript/wardrobe-2020/util.js index f99b7f11..53403cd6 100644 --- a/app/javascript/wardrobe-2020/util.js +++ b/app/javascript/wardrobe-2020/util.js @@ -161,7 +161,11 @@ export function safeImageUrl( archiveUrl.search = new URLSearchParams({ url: url.toString() }); url = archiveUrl; } else if (crossOrigin) { - url.host = "images.neopets-asset-proxy.openneo.net"; + // NOTE: Previously we would rewrite this to our proxy that adds an + // `Access-Control-Allow-Origin` header (images.neopets-asset-proxy. + // openneo.net), but images.neopets.com now includes this header for us! + // + // So, do nothing! } } else if ( url.origin === "http://pets.neopets.com" ||