question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to enable CORS headers with terracotta serve?

See original GitHub issue

When trying the new terracotta preview against a locally run terracotta serve, I get errors because of missing CORS headers.

This issue is popping up now, because the new preview app is using Mapbox as a map provider instead of Leaflet and data is now loaded programmatically instead of just pasting the PNG links into the browser (which do not requite CORS headers). Anways.

I tried to set TC_ALLOWED_ORIGINS_TILES and can see that it gets included in the config at runtime, but somehow that did not help?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
dionhaefnercommented, Apr 26, 2021

I mean adding localhost to allowed origins, so the use case terracotta serve && terracotta connect always works. I wouldn’t allow all by default.

0reactions
chapmanjacobdcommented, Jun 13, 2021

yeah adding localhost by default makes a lot more sense than having no default since modern browsers seem to block localhost requests which have no CORS header set; at least in Firefox

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Set Access-Control-Allow-Origin (CORS) Headers in ...
2. Open Apache Configuration File. You can enable CORS in Apache by modifying Apache Server configuration file, or .htaccess file. Using Apache ...
Read more >
Configuration — Terracotta 0.7.6.dev103+g964a72b ...
Your application might need Terracotta to allow CORS for some or all hostnames. For example, this is required when using Mapbox GL to...
Read more >
CORS in JAX-RS - Baeldung
There are two ways by which we can enable CORS in JAX-RS. The first and the most basic way is to create a...
Read more >
Apache Camel Development Guide Red Hat Fuse 7.0
If true , enables CORS (cross-origin resource sharing) headers in the HTTP response. Default is false . id(). @id. Defines a unique ID...
Read more >
Enabling Cross-Origin Resource Sharing (CORS) with HAProxy
OPTION request mengharapkan response yang menyatakan origin, headers, dan HTTP method apa saja yang diijinkan oleh aplikasi backend untuk ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found