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:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-09-12 13:00:22 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-09-13 10:42:22 +0300
commit1198f4ee2f3f216cde7b318505f7ebdfe8d7e338 (patch)
tree6a7fed36f4725894c835a5c56cdd0677de812dac /internal/request
parentdd802698dba879ef5eeeb7b4f4abd03364f3788f (diff)
Rename confusing domain struct from D to Domain
Diffstat (limited to 'internal/request')
-rw-r--r--internal/request/request.go6
-rw-r--r--internal/request/request_test.go6
2 files changed, 6 insertions, 6 deletions
diff --git a/internal/request/request.go b/internal/request/request.go
index 730eb527..74982f33 100644
--- a/internal/request/request.go
+++ b/internal/request/request.go
@@ -28,7 +28,7 @@ func IsHTTPS(r *http.Request) bool {
}
// WithHostAndDomain saves host name and domain in the request's context
-func WithHostAndDomain(r *http.Request, host string, domain *domain.D) *http.Request {
+func WithHostAndDomain(r *http.Request, host string, domain *domain.Domain) *http.Request {
ctx := r.Context()
ctx = context.WithValue(ctx, ctxHostKey, host)
ctx = context.WithValue(ctx, ctxDomainKey, domain)
@@ -42,6 +42,6 @@ func GetHost(r *http.Request) string {
}
// GetDomain extracts the domain from request's context
-func GetDomain(r *http.Request) *domain.D {
- return r.Context().Value(ctxDomainKey).(*domain.D)
+func GetDomain(r *http.Request) *domain.Domain {
+ return r.Context().Value(ctxDomainKey).(*domain.Domain)
}
diff --git a/internal/request/request_test.go b/internal/request/request_test.go
index 97e40ee4..4bb3c0be 100644
--- a/internal/request/request_test.go
+++ b/internal/request/request_test.go
@@ -42,17 +42,17 @@ func TestWithHostAndDomain(t *testing.T) {
tests := []struct {
name string
host string
- domain *domain.D
+ domain *domain.Domain
}{
{
name: "values",
host: "gitlab.com",
- domain: &domain.D{},
+ domain: &domain.Domain{},
},
{
name: "no_host",
host: "",
- domain: &domain.D{},
+ domain: &domain.Domain{},
},
}
for _, tt := range tests {