Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--domains.go3
-rw-r--r--domains_test.go7
-rw-r--r--shared/pages/group/group.test.io/config.json2
3 files changed, 10 insertions, 2 deletions
diff --git a/domains.go b/domains.go
index d298b63b..1fed6324 100644
--- a/domains.go
+++ b/domains.go
@@ -44,8 +44,9 @@ func (d domains) readProjectConfig(rootDomain, group, project string) (err error
}
for _, domainConfig := range config.Domains {
+ config := domainConfig // domainConfig is reused for each loop iteration
if domainConfig.Valid(rootDomain) {
- d.addDomain(rootDomain, group, project, &domainConfig)
+ d.addDomain(rootDomain, group, project, &config)
}
}
return
diff --git a/domains_test.go b/domains_test.go
index 5a2882d6..6ce11f5f 100644
--- a/domains_test.go
+++ b/domains_test.go
@@ -40,6 +40,13 @@ func TestReadProjects(t *testing.T) {
for _, actual := range domains {
assert.Contains(t, expectedDomains, actual)
}
+
+ // Check that multiple domains in the same project are recorded faithfully
+ exp1 := &domainConfig{Domain: "test.domain.com"}
+ assert.Equal(t, exp1, d["test.domain.com"].Config)
+
+ exp2 := &domainConfig{Domain: "other.domain.com", Certificate: "test", Key: "key"}
+ assert.Equal(t, exp2, d["other.domain.com"].Config)
}
func writeRandomTimestamp() {
diff --git a/shared/pages/group/group.test.io/config.json b/shared/pages/group/group.test.io/config.json
index 1643525d..5b9be1fd 100644
--- a/shared/pages/group/group.test.io/config.json
+++ b/shared/pages/group/group.test.io/config.json
@@ -9,7 +9,7 @@
{
"Domain": "other.domain.com",
"Certificate": "test",
- "Certificate": "key"
+ "Key": "key"
}
]
}