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: 调整 dev_sandbox cors 相关配置的环境变量名称 #1718

Merged
Merged
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
10 changes: 5 additions & 5 deletions cnb-builder-shim/internal/devsandbox/config/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ func loadSourceConfigFromEnv() (SourceCodeConfig, error) {
}

func loadCORSConfigFromEnv() (CORSConfig, error) {
allowOrigins := getListFromEnv("ALLOW_ORIGINS", "")
allowMethods := getListFromEnv("ALLOW_METHODS", "GET,POST,PUT,DELETE,OPTIONS")
allowHeaders := getListFromEnv("ALLOW_HEADERS", "Origin,Content-Type,Authorization")
exposeHeaders := getListFromEnv("EXPOSE_HEADERS", "Content-Length")
allowCredentials := utils.EnvOrDefault("ALLOW_CREDENTIALS", "true") == "true"
allowOrigins := getListFromEnv("CORS_ALLOW_ORIGINS", "")
allowMethods := getListFromEnv("CORS_ALLOW_METHODS", "GET,POST,PUT,DELETE,OPTIONS")
allowHeaders := getListFromEnv("CORS_ALLOW_HEADERS", "Origin,Content-Type,Authorization")
exposeHeaders := getListFromEnv("CORS_EXPOSE_HEADERS", "Content-Length")
allowCredentials := utils.EnvOrDefault("CORS_ALLOW_CREDENTIALS", "true") == "true"
return CORSConfig{
AllowOrigins: allowOrigins,
AllowMethods: allowMethods,
Expand Down