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

Relax server-side CORS #111

Open
empmud opened this issue Jan 18, 2021 · 0 comments
Open

Relax server-side CORS #111

empmud opened this issue Jan 18, 2021 · 0 comments

Comments

@empmud
Copy link

empmud commented Jan 18, 2021

Local development cannot be done on Firefox, only Chromium with a secondary user profile and a disable security flag. This is because CORS preflight requests receive HTTP 500 responses to their OPTIONS requests.

It might be possible for an extension to modify the CORS preflight request, but I none of the ones I've tried can rewrite an error response into a success response.

It would be nice if the server allowed any origin to connect to the chat endpoints.

Example preflight request

Request URL: https://www.hackmud.com/mobile/get_token.json
Request method: OPTIONS
Status code: 500
Access-Control-Request-Method: POST
Access-Control-Request-Headers: content-type
Referer: http://nothackmud.com/
Origin: http://nothackmud.com/

An alternative might be to add a server-side proxy for development: Route requests to the node.js server who hands them off to the original hackmud server. This avoids CORS by being on the same domain, but that's a bit of a fiddle when the server could be amended.

empmud added a commit to empmud/hackmud_chat_web that referenced this issue Jan 21, 2021
empmud added a commit to empmud/hackmud_chat_web that referenced this issue Jan 21, 2021
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

No branches or pull requests

1 participant