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

Fix lint errors after merging AllowedHeaders feature #3247

Merged
merged 1 commit into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/dex/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ type Web struct {
TLSCert string `json:"tlsCert"`
TLSKey string `json:"tlsKey"`
AllowedOrigins []string `json:"allowedOrigins"`
AllowedHeaders []string `json:"allowedHeaders"`
AllowedHeaders []string `json:"allowedHeaders"`
}

// Telemetry is the config format for telemetry including the HTTP server config.
Expand Down
2 changes: 1 addition & 1 deletion cmd/dex/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ func runServe(options serveOptions) error {
AlwaysShowLoginScreen: c.OAuth2.AlwaysShowLoginScreen,
PasswordConnector: c.OAuth2.PasswordConnector,
AllowedOrigins: c.Web.AllowedOrigins,
AllowedHeaders: c.Web.AllowedHeaders,
AllowedHeaders: c.Web.AllowedHeaders,
Issuer: c.Issuer,
Storage: s,
Web: c.Frontend,
Expand Down
10 changes: 5 additions & 5 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ type Config struct {
// domain.
AllowedOrigins []string

// List of allowed headers for CORS requests on discovery, token, and keys endpoint.
AllowedHeaders []string
// List of allowed headers for CORS requests on discovery, token, and keys endpoint.
AllowedHeaders []string

// If enabled, the server won't prompt the user to approve authorization requests.
// Logging in implies approval.
Expand Down Expand Up @@ -217,9 +217,9 @@ func newServer(ctx context.Context, c Config, rotationStrategy rotationStrategy)
if len(c.SupportedResponseTypes) == 0 {
c.SupportedResponseTypes = []string{responseTypeCode}
}
if len(c.AllowedHeaders) == 0 {
c.AllowedHeaders = []string{"Authorization"}
}
if len(c.AllowedHeaders) == 0 {
c.AllowedHeaders = []string{"Authorization"}
}

allSupportedGrants := map[string]bool{
grantTypeAuthorizationCode: true,
Expand Down
Loading