Skip to content
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.

fix CORS for deployments #302

Merged
merged 1 commit into from
Jun 29, 2017
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
6 changes: 4 additions & 2 deletions deployment/monocular/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ api:
# source: my-repository-source
cors:
allowed_origins:
- my-api-server
- ""
# e.g. UI served on a different domain
# - http://monocular.local
allowed_headers:
- "access-control-allow-headers"
- "content-type"
- "x-xsrf-token"
# Enable Helm deployment integration
releasesEnabled: true
Expand Down
4 changes: 2 additions & 2 deletions docs/config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ repos:

# cors:
# allowed_origins:
# - my-api-server
# - my-ui-hostname
# allowed_headers:
# - "access-control-allow-headers"
# - "content-type"
# - "x-xsrf-token"

# Enables Helm deployment integration
Expand Down
4 changes: 2 additions & 2 deletions src/api/config/cors/cors.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ func defaultCors() (Cors, error) {
}
// Defaults
return Cors{
AllowedOrigins: []string{"my-api-server"},
AllowedHeaders: []string{"access-control-allow-headers", "x-xsrf-token"},
AllowedOrigins: []string{""},
AllowedHeaders: []string{"content-type", "x-xsrf-token"},
}, nil
}

Expand Down
4 changes: 2 additions & 2 deletions src/api/config/cors/cors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ var configFileOk = filepath.Join("..", "testdata", "config.yaml")
var configFileNotOk = filepath.Join("..", "testdata", "bogus_config.yaml")
var configFileNoCors = filepath.Join("..", "testdata", "nocors_config.yaml")
var defaultExpectedCors = Cors{
AllowedOrigins: []string{"my-api-server"},
AllowedHeaders: []string{"access-control-allow-headers", "x-xsrf-token"},
AllowedOrigins: []string{""},
AllowedHeaders: []string{"content-type", "x-xsrf-token"},
}

func TestConfigFileDoesNotExist(t *testing.T) {
Expand Down