From 02d7cf73bb3ad33ded297b2d8973dbfef4c7e880 Mon Sep 17 00:00:00 2001 From: Matchu Date: Sat, 12 Jun 2021 02:29:30 -0700 Subject: [PATCH] Support HTTPS asset URLs There are a couple spots where we parse SWF URLs to get the ID out! Most visibly, our Support tools were crashing on it. And internally, manifest loading wasn't working. (I'm not sure if this got caught or if it caused crashes in user space? I didn't see them when wearing a failing item) Anyway, fixed now! --- src/app/WardrobePage/support/AppearanceLayerSupportModal.js | 2 +- src/server/neopets-assets.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/WardrobePage/support/AppearanceLayerSupportModal.js b/src/app/WardrobePage/support/AppearanceLayerSupportModal.js index 48ca453..e71acf3 100644 --- a/src/app/WardrobePage/support/AppearanceLayerSupportModal.js +++ b/src/app/WardrobePage/support/AppearanceLayerSupportModal.js @@ -620,7 +620,7 @@ function AppearanceLayerSupportModalRemoveButton({ ); } -const SWF_URL_PATTERN = /^http:\/\/images\.neopets\.com\/cp\/(bio|items)\/swf\/(.+?)_([a-z0-9]+)\.swf$/; +const SWF_URL_PATTERN = /^https?:\/\/images\.neopets\.com\/cp\/(bio|items)\/swf\/(.+?)_([a-z0-9]+)\.swf$/; function convertSwfUrlToPossibleManifestUrls(swfUrl) { const match = new URL(swfUrl, "http://images.neopets.com") diff --git a/src/server/neopets-assets.js b/src/server/neopets-assets.js index 53c67ac..179e40d 100644 --- a/src/server/neopets-assets.js +++ b/src/server/neopets-assets.js @@ -34,7 +34,7 @@ async function loadAssetManifest(swfUrl) { }; } -const SWF_URL_PATTERN = /^http:\/\/images\.neopets\.com\/cp\/(bio|items)\/swf\/(.+?)_([a-z0-9]+)\.swf$/; +const SWF_URL_PATTERN = /^https?:\/\/images\.neopets\.com\/cp\/(bio|items)\/swf\/(.+?)_([a-z0-9]+)\.swf$/; function convertSwfUrlToPossibleManifestUrls(swfUrl) { const match = new URL(swfUrl, "http://images.neopets.com")