fair-analytics icon indicating copy to clipboard operation
fair-analytics copied to clipboard

CORS for get endpoints

Open benwiley4000 opened this issue 5 years ago • 2 comments

Unless I'm missing something, it seems like there's no supported way to access the endpoints like /_stats and /_live outside of the analytics domain in a browser. It seems relatively harmless for these to be access-control-allow-origin: *. However that should be different configuration than cors for post requests, since while it makes sense to make the auditing info available wherever, I'd likewise want to be able to restrict analytics post requests to a single domain.

I'd be happy to make a PR if we can agree on what the API would look like. What do you think? I'm wondering if it makes sense to add a new flag called endpointsOrigin which is the same as origin but only for the non-/ GET endpoints?

benwiley4000 avatar Mar 31 '19 00:03 benwiley4000

hey @benwiley4000 thanks for the input. I think what you said makes perfect sense. We definitely want to have those endpoints available from other domains.

Since the change is harmless, as you mentioned, I'd change the default CORS config for those specific endpoints rather than introducing a new configuration flag. What do you think?

vesparny avatar Apr 01 '19 07:04 vesparny

Sounds fine to me! Thanks!

Le lun. 1 avr. 2019 03 h 47, Alessandro Arnodo [email protected] a écrit :

hey @benwiley4000 https://github.com/benwiley4000 thanks for the input. I think what you said makes perfect sense. We definitely want to have those endpoints available from other domains.

Since the change is harmless, as you mentioned, I'd change the default CORS config for those specific endpoints rather than introducing a new configuration flag. What do you think?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vesparny/fair-analytics/issues/21#issuecomment-478472236, or mute the thread https://github.com/notifications/unsubscribe-auth/AM7h7UnPHDzWrYMXRQIQOKZTXNg1iD1Lks5vcbl1gaJpZM4cUDMW .

benwiley4000 avatar Apr 01 '19 13:04 benwiley4000