-
Notifications
You must be signed in to change notification settings - Fork 7
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
fix: allow all origins in devMode #3444
Conversation
frontend/cli/cmd_serve.go
Outdated
// Add controller address to allow origins for console requests. | ||
// The console is run on `localhost` so we replace 127.0.0.1 with localhost. | ||
if addr.Hostname() == "127.0.0.1" { | ||
addr.Host = "localhost" + ":" + addr.Port() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW we shouldn't run on "localhost" as it can trigger Mac security popups.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this one is interesting. I had to add this to solve a problem with running locally with my mac and it's working currently, but I def want to do whatever is correct here. Lemme try a few things here before merging, but this part of the code has been around for a while.
frontend/cli/cmd_serve.go
Outdated
|
||
if devMode && len(s.CommonConfig.AllowHeaders) == 0 { | ||
// Default to allowing all headers for console requests in local dev mode. | ||
if devMode { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to this PR but I just realised - what is "!devMode"? ftl dev/ftl serve
are always dev mode...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha! I had the exact same question/thought when i was doing this. I think it's a flag that gets passed in and needs to get forwarded onto other code from within the cmd_serve
. But it's only used/set by cmd_dev
and it's always true.
309be0e
to
9ba1687
Compare
No description provided.