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

Correctly setup CORS for the webui #48

Open
FrostyCoolSlug opened this issue Mar 10, 2023 · 6 comments
Open

Correctly setup CORS for the webui #48

FrostyCoolSlug opened this issue Mar 10, 2023 · 6 comments

Comments

@FrostyCoolSlug
Copy link
Member

The WebUI currently misconfigures CORS if --http-enable-cors is enabled, as it will only accept 'external' requests from localhost.

Look into providing a cleaner method of allowing users to define acceptable hosts (defaulting to localhost if none are defined).

@bonsai-rishabh
Copy link

Does this issue still need work? I would be willing to try this out if needed.

@FrostyCoolSlug
Copy link
Member Author

Yea, this is still needed (you can't load profiles in the UIs Dev mode when bind address is set), so I'd appreciate any help :)

@bonsai-rishabh
Copy link

Sounds good, if you have any ideas on where to start looking for this too I would appreciate that. Feel free to assign this to me for now

@FrostyCoolSlug
Copy link
Member Author

FrostyCoolSlug commented Aug 2, 2023

You'll need to start in cli.rs to add a new command line parameter which allows for a list of strings (might be best to check the clap documentation to see if there's a native way to handle that), then in main.rs, similar to the bind address, have defaults if cors is enabled but that CLI value is not set. Pass it into the HttpSettings struct, then inside the web server code adjust the CORS settings based on the values.

@bonsai-rishabh
Copy link

Thanks for the tips, I will start reading up the codebase, also wondering if there were any particular guidelines on branches/branch names or anything I should keep in mind before I start writing anything?

@FrostyCoolSlug
Copy link
Member Author

Nothing overt at the moment, the main key is that you'll want to make sure you're working off the latest Dev branch (dev-1.0.0 currently) and send your PR into that branch, once 1.0 is released I may tighten that up a bit, but for now it's sufficient.

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

2 participants