Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blocked by CORS policy #3273

Closed
1 of 3 tasks
ApertureDevelopment opened this issue Apr 6, 2019 · 7 comments · Fixed by #4255
Closed
1 of 3 tasks

Blocked by CORS policy #3273

ApertureDevelopment opened this issue Apr 6, 2019 · 7 comments · Fixed by #4255
Labels
core Server, BaseService, GitHub auth, Shared helpers

Comments

@ApertureDevelopment
Copy link

ApertureDevelopment commented Apr 6, 2019

Are you experiencing an issue with...

🪲 Description

When I try using the badges in a Steam addon description, I get this error and the badge doesnt show up:

Access to image at 'https://img.shields.io/github/issues-raw/Aperture-Development/MSync-2.png' from origin 'https://steamcommunity.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

🔗 Link to the badge

https://img.shields.io/github/issues-raw/Aperture-Development/MSync-2.png

Steps for reproduction:

  1. Generate a badge
  2. Add it like this: [img]{badge}[/img] to your addon description
@paulmelnikow
Copy link
Member

Hi, thanks for the report. I don’t see any reason we couldn’t add CORS headers.

@paulmelnikow paulmelnikow added the core Server, BaseService, GitHub auth, Shared helpers label Apr 6, 2019
@ApertureDevelopment
Copy link
Author

ApertureDevelopment commented Apr 6, 2019

When will that be fixed?

@paulmelnikow
Copy link
Member

The maintainers and contributors all work on this project in their spare time, so there’s no timeline I’m afraid! This is a community project; anyone who is interested in trying to solve the problem is welcome to. The maintainers are happy to provide guidance and review code. (If you don’t want to or aren’t able to, no worries! Maybe someone else will come along and work on it.)

In terms of technical advice, I’ve used the cors package before, which is the standard way to go about this. Though I’ve never done it with Scoutcamp (that’s the web framework Shields uses) and I’m not sure if there is a CORS handler built in. The relevant bits of code would probably belong in core/server, and a corresponding test would belong there as well.

@paulmelnikow
Copy link
Member

It may also be worth researching whether anything has to be configured in Cloudflare for CORS.

@chris48s
Copy link
Member

chris48s commented Apr 6, 2019

I think all the other headers we set are passed through by CloudFlare without having to whitelist them. The same-origin policy is implemented in the browser sandbox, so we should only need to add the header.

@jcxldn
Copy link
Contributor

jcxldn commented Apr 11, 2019

We should just be able to add Access-Control-Allow-Origin: * as a header to every request.

CloudFlare, no matter what settings you set, will not interfere with CORS, and will pass it through unaltered.

@paulmelnikow
Copy link
Member

Fixed in #4171 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Server, BaseService, GitHub auth, Shared helpers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants