Seneca-CDOT / telescope

A tool for tracking blogs in orbit around Seneca's open source involvement
https://telescope.cdot.systems
BSD 2-Clause "Simplified" License
96 stars 189 forks source link

[Satellite] Add CORS to health checks #2444

Open humphd opened 3 years ago

humphd commented 3 years ago

When I try to run on GitPod, I get this CORS error:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://3000-jade-rook-9uumsqb5.ws-us17.gitpod.io/health. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

The problem comes from our microservice base, Satellite. Here we define healthchecks as part of using Terminus:

https://github.com/Seneca-CDOT/satellite/blob/d42a831a8ca6666dd5759eeccdbe932fe34239ca/src/satellite.js#L20

It would be great if we could add CORS to these as well.

LuigiZaccagnini commented 2 years ago

I can take this issue @humphd

LuigiZaccagnini commented 2 years ago

Fixing this terminus issue to help solve this issue.

LuigiZaccagnini commented 2 years ago

"This code here https://github.com/Seneca-CDOT/telescope/blob/master/src/api/status/src/server.js#L75-L83 and https://github.com/Seneca-CDOT/telescope/blob/master/src/api/status/src/services.js could get migrated into the client-side of the status page." - David Humphrey

Writing this here to document it so I don't lose it as I go down the rabbit hole!

humphd commented 2 years ago

We're landing support for this in Satellite with https://github.com/Seneca-CDOT/satellite/pull/48, so we can move forward on this as soon as ship an update.

JerryHue commented 2 years ago

@tpmai22, this might have been fixed in #3233. Could you test that this is the case? I guess that you'd have to go to GitPod and check that the error is still there. If it is not, let us know.