-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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: enable CORS with hot-reloaded origins #3601
Conversation
@@ -78,11 +74,11 @@ func RunServeAdmin(slOpts []servicelocatorx.Option, dOpts []driver.OptionsModifi | |||
ctx := cmd.Context() | |||
sl := servicelocatorx.NewOptions(slOpts...) | |||
|
|||
d, err := driver.New(cmd.Context(), sl, append(dOpts, driver.WithOptions(configx.WithFlags(cmd.Flags())))) | |||
d, err := driver.New(cmd.Context(), sl, append(dOpts, driver.WithOptions(append(cOpts, configx.WithFlags(cmd.Flags()))...))) |
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 sure why those options were not passed on?
cmd/server/handler.go
Outdated
@@ -312,6 +308,9 @@ func serve( | |||
) { | |||
defer wg.Done() | |||
|
|||
cfg, _ := d.Config().CORS(ctx, iface) | |||
handler = cors.New(cfg).Handler(handler) |
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.
Always enabled now because the function hot-reloads "enabled" as well.
Codecov Report
@@ Coverage Diff @@
## master #3601 +/- ##
==========================================
- Coverage 76.28% 76.27% -0.01%
==========================================
Files 132 132
Lines 9984 9987 +3
==========================================
+ Hits 7616 7618 +2
- Misses 1848 1849 +1
Partials 520 520
|
# Conflicts: # go.mod # go.sum
As far as I can tell CORS cannot work right now 😅
See ory/kratos#3423