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:
parent
d283884781
commit
10be4c4ea1
2 changed files with 2 additions and 1 deletions
|
@ -7,6 +7,7 @@ const streamPipeline = util.promisify(stream.pipeline);
|
||||||
const VALID_URL_PATTERNS = [
|
const VALID_URL_PATTERNS = [
|
||||||
/^http:\/\/images\.neopets\.com\/items\/[a-zA-Z0-9_ -]+\.gif$/,
|
/^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)\/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) => {
|
export default async (req, res) => {
|
||||||
|
|
|
@ -321,7 +321,7 @@ function ItemLayerSupportFlashPlayer({ swfUrl, backgroundColor }) {
|
||||||
>
|
>
|
||||||
<object
|
<object
|
||||||
type="application/x-shockwave-flash"
|
type="application/x-shockwave-flash"
|
||||||
data={swfUrl}
|
data={`/api/assetProxy?url=${encodeURIComponent(swfUrl)}`}
|
||||||
width="100%"
|
width="100%"
|
||||||
height="100%"
|
height="100%"
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in a new issue