Skip to content

Conversation

@SebastianAigner
Copy link
Contributor

I am tinkering on a project that explores some additional functionality for the web interface such as prompt queueing. Projects like these (where dev servers and deployed versions run on a different host or port than the stable-diff embedded web server) are currently suffering from failing preflight requests and additional CORS errors, since the server does not provide appropriate header responses.

This PR adds the Access-Control-Allow-Origin and Access-Control-Allow-Headers CORS headers to the appropriate responses, as well as adds the OPTION HTTP method for preflight requests.

greentext2 and others added 3 commits September 3, 2022 14:41
pip3 version did not work for me and this is the recommended way to install Anaconda now it seems
* fix img2img variations

* fix assert for variation_amount
@lstein lstein changed the base branch from main to development September 4, 2022 12:15
Copy link
Collaborator

@lstein lstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works as advertised. Thank you.

@lstein lstein merged commit 3a2be62 into invoke-ai:development Sep 4, 2022
@bakkot
Copy link
Contributor

bakkot commented Sep 4, 2022

I really don't think this should be on by default. This means that any website you visit can talk to the web UI, including submitting requests. That's certainly not something I'd expect to happen without opting in, and it's also something we'd almost certainly for which we'd want to have much stricter auditing of the security of the code before enabling at all (imagine if this went in before #133).

The cross-origin restrictions are a security feature and there's good reason they're on by default.

@nderscore
Copy link
Contributor

nderscore commented Sep 4, 2022

I think this would be better as a CLI argument --cors which lets you configure the value of the Access-Control-Allow-Origin header explicitly

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.

5 participants