1

I have a bunch of marathon servers set up for some tests that are automatically run, and I would like to make a dashboard that shows the health of each of the micro-services on all 5 of the servers so that I can see if everything is healthy all at once, rather than having to load the individual pages.

When I try to do so I get the error

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote 
resource at http://host.com:8080/v2/tasks. 
(Reason: CORS header 'Access-Control-Allow-Origin' missing).

I've been reading up on this error and I've seen that if you add the Access-Control-Allow-Origin header in the response from the marathon server that it should allow cross origin requests, but I have no idea how to do this/if this is possible.

Does anyone know if it's possible to change some settings in marathon or something that would allow me to do cross origin requests?

annedroiid
  • 6,267
  • 11
  • 31
  • 54
  • I've been reading up on how it works, but that doesn't help me with this specific situation of knowing if I can change the settings in marathon. I can't find anything in the Marathon documentation in regards to it, and it says for support to post things on Stackoverflow with the marathon tag. – annedroiid Jan 08 '17 at 23:41
  • 1
    I wonder which Marathon version you're using since it's available, at least in newer ones, see [CORSFilter.scala](https://github.com/mesosphere/marathon/blob/master/src/main/scala/mesosphere/marathon/api/CORSFilter.scala). – Michael Hausenblas Jan 09 '17 at 09:35
  • 1
    I'm not sure exactly what version but I know it's not the latest one. I'll have to see if I can get my office to upgrade. If you post that is an answer I'll accept it :) – annedroiid Jan 09 '17 at 23:42

1 Answers1

1

Suggest to check the Marathon version you're using since CORS is supported, at least in newer versions (since late 2015, IIRC). See CORSFilter.scala for background.

Michael Hausenblas
  • 13,162
  • 4
  • 52
  • 66