neoascetic / rawgithack

Serves files from github, bitbucket and gitlab, but with the correct content types
https://raw.githack.com
MIT License
577 stars 89 forks source link

Re-direct results in not being able to bypass CORS #40

Closed kasbah closed 5 years ago

kasbah commented 5 years ago

I am not sure bypassing gitlabs CORS policy on artifacts is one of the goals of this project but I would find that really handy. It currently works for most artifacts but not when you are trying to use re-directs.

https://glcdn.githack.com/openflexure/openflexure-microscope/-/jobs/artifacts/master/raw/builds/main_body_LS65.stl?job=STLs

re-directs to

https://gitlab.com/openflexure/openflexure-microscope/-/jobs/223115318/artifacts/raw/builds/main_body_LS65.stl

so when I try and use URLs like that that grab the latest artifacts from the master branch I get CORS errors.

kasbah commented 5 years ago

Relevant: https://stackoverflow.com/a/26025618

neoascetic commented 5 years ago

Hello. That’s because .stl is not supported extension. When we do not support something, we simply redirect to the origin. That’a why you have CORS problems.

Do you want .stl to be supported?

On 1 Jun 2019, at 08:34, Kaspar Emanuel notifications@github.com wrote:

Relevant: https://stackoverflow.com/questions/20254456/intercepting-backend-301-302-redirects-proxy-pass-and-rewriting-to-another-loc

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

kasbah commented 5 years ago

That would be great! MIME is model/stl I believe. https://www.iana.org/assignments/media-types/model/stl

neoascetic commented 5 years ago

STLs are now supported. But you have to use specific job URL if you want them to work.