[BUG] New default maps service cached policy causing CORS issue
See original GitHub issueDescribe the bug
We navigating to a new maps services maps.opensearch.org
. Went trying to use it out of the box I keep getting a CORS issue when trying to access a visualization with maps. I had to manually clear my cache then I was able to see maps out of the box. It could potentially be we got some policy cached for the old service and when it attempts to make a call it is making a call with the old policy causing a CORS issue.
To Reproduce Steps to reproduce the behavior:
- Have old service working
- Create a viz with region maps
- Notice map
- Use new map service
- Create a viz with region maps
- Notice CORS issue
Expected behavior Maps works out of the box
OpenSearch Version 1.2
Dashboards Version 1.2
Plugins n/a
Screenshots n/a
Additional context
Need to verify if other folks are seeing this. And will add more content to this issue once I recreate it.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Fixing Common Problems with CORS and JavaScript
Tutorial: This post walks through troubleshooting and fixing common problems associated with calling REST APIs from JavaScript.
Read more >Caching effect on CORS: No 'Access-Control-Allow-Origin ...
First client sends the Origin request header => Cloudfront server caches the response without CORS headers. This made the problem look like it ......
Read more >CORS errors - HTTP - MDN Web Docs - Mozilla
If the CORS configuration isn't setup correctly, the browser console will present an error like "Cross-Origin Request Blocked: The Same Origin ...
Read more >CORS Errors: Cross-Origin Resource Sharing - Ionic Framework
CORS errors happen in web apps if requests are made and servers don't return required headers. Read about Cross-Origin Resource Sharing in Ionic ......
Read more >Cross-origin resource sharing (CORS) | Cloud Storage
XML API endpoints accept CORS requests based on the CORS configuration on the target bucket. The authenticated browser download endpoint storage.cloud.google.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@tmarkley @kavilla I understand we changed something in a live configuration. That’s ok as an immediate workaround, but it’s not a fix. I’ll reopen until we confirm that the change made it into code (CDK or otherwise).
Looking at the headers of the failure, we found that CORS headers were missing in the response from the CDN. That is even though the CDN was configured to respond with CORS headers and had been working fine.
One theory is that the failing file,
v2.json
, was requested in a non-XHR context and a CDN edge cached the response without the CORS headers. Subsequently, a request for the same file, when made viafetch
, received the cached response from the CDN which didn’t contain the CORS headers.Steps to reproduce:
https://maps.opensearch.org/tiles/v2.json?osd_version=1.2&opensearch_tos_agree=true
in your browser.fetch
in the console of the browser’s dev-tools:Will continue to look for other explanations with refreshing the CDN cache.