use asset proxy for SWF upload tool

Oops, I forgot that in prod the HTTPS wouldn't be happy about loading SWFs over HTTP! Use the asset proxy instead.
This commit is contained in:
Emi Matchu 2020-08-05 13:08:18 -07:00
parent d283884781
commit 10be4c4ea1
2 changed files with 2 additions and 1 deletions

View file

@ -7,6 +7,7 @@ const streamPipeline = util.promisify(stream.pipeline);
const VALID_URL_PATTERNS = [
/^http:\/\/images\.neopets\.com\/items\/[a-zA-Z0-9_ -]+\.gif$/,
/^http:\/\/images\.neopets\.com\/cp\/(bio|items)\/data\/[0-9]{3}\/[0-9]{3}\/[0-9]{3}\/[a-f0-9_]+\/[0-9]+\.svg$/,
/^http:\/\/images\.neopets\.com\/cp\/(bio|items)\/swf\/[0-9]{3}\/[0-9]{3}\/[0-9]{3}\/[a-f0-9_]+\.swf$/,
];
export default async (req, res) => {

View file

@ -321,7 +321,7 @@ function ItemLayerSupportFlashPlayer({ swfUrl, backgroundColor }) {
>
<object
type="application/x-shockwave-flash"
data={swfUrl}
data={`/api/assetProxy?url=${encodeURIComponent(swfUrl)}`}
width="100%"
height="100%"
>