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

Give JSON files the Access-Control-Allow-Origin: * header #2172

Merged
merged 2 commits into from
Nov 4, 2023
Merged

Give JSON files the Access-Control-Allow-Origin: * header #2172

merged 2 commits into from
Nov 4, 2023

Conversation

LumarisX
Copy link
Contributor

Updating the .htaccess file to allow moves, abilities, and learnsets json files to be accessed across domain by adding the Access-Control-Allow-Origin: * header.

From the research I did on the .htaccess file, this should solve the issue, but I couldn't see these files in my test environment to confirm that this is a fix.

@singiamtel
Copy link
Contributor

Doesn't the browser ignore CORS when requesting JSONs?

@LumarisX
Copy link
Contributor Author

Unless I misunderstood something in my research, no. When I pull moves.json this is the error I see.
image

When I pull news.json however, it works. Only difference being the header.

@singiamtel
Copy link
Contributor

Yeah you're right, my bad

@Zarel Zarel changed the title Giving JSON files the Access-Control-Allow-Origin: * header Give JSON files the Access-Control-Allow-Origin: * header Nov 3, 2023
@Zarel Zarel merged commit f9bc940 into smogon:master Nov 4, 2023
1 check passed
@Zarel
Copy link
Member

Zarel commented Nov 4, 2023

Thanks!

MathyFurret pushed a commit to MathyFurret/pokemon-showdown-client that referenced this pull request Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants