This is your daily "I don't understand CORS post". We deployed a static asset to R2 fetched in JS by

This is your daily "I don't understand CORS post". We deployed a static asset to R2 fetched in JS by our site. It was failing when deployed on cors headers so I added a catch all to allow all origins

Unfortunately for some reason this broke my ability to access it from localhost
avatar:1  Access to XMLHttpRequest at 'https://thumbnails.r2.allout.game/playercharacter-21.json' from origin 'http://localhost:3010' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values 'http://localhost:3010, *', but only one is allowed.


So I added a rule to not include my local IP in this cors rule. Is there any way to do this better so I don't have to keep rotating my local IP in this rule to access it while developing?
image.png
Was this page helpful?