diff options
author | Nick Thomas <nick@gitlab.com> | 2019-09-13 18:46:52 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-09-13 18:46:52 +0300 |
commit | fc8f04d5fef6d36568f751e0ebb724a22959cb96 (patch) | |
tree | 4e80184def1dd2cca60c5cc2cd191fe9681bda9d /internal/request | |
parent | 75d00b984b3edd2832f28a1fa397bd7ad9e4bbbd (diff) | |
parent | 1198f4ee2f3f216cde7b318505f7ebdfe8d7e338 (diff) |
Merge branch 'backstage/gb/rename-confusig-domain-struct' into 'master'1-9-stable
Rename confusing domain struct
See merge request gitlab-org/gitlab-pages!184
Diffstat (limited to 'internal/request')
-rw-r--r-- | internal/request/request.go | 6 | ||||
-rw-r--r-- | internal/request/request_test.go | 6 |
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 afb40142..e092448b 100644 --- a/internal/request/request_test.go +++ b/internal/request/request_test.go @@ -41,17 +41,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 { |