Skip to content

Commit bf0f5c1

Browse files
committed
use consistent hidden domain matching everywhere
1 parent c3d88a7 commit bf0f5c1

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

auth/hmac.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func (auth *HMACAuth) Validate(ctx context.Context, wr http.ResponseWriter, req
127127

128128
if VerifyHMACLoginAndPassword(auth.secret, login, password) {
129129
if auth.hiddenDomain != "" &&
130-
(req.Host == auth.hiddenDomain || req.URL.Host == auth.hiddenDomain) {
130+
(matchHiddenDomain(req.Host, auth.hiddenDomain) || matchHiddenDomain(req.URL.Host, auth.hiddenDomain)) {
131131
wr.Header().Set("Content-Length", strconv.Itoa(len([]byte(AUTH_TRIGGERED_MSG))))
132132
wr.Header().Set("Pragma", "no-cache")
133133
wr.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")

auth/redis.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func (auth *RedisAuth) Validate(ctx context.Context, wr http.ResponseWriter, req
120120

121121
if matcher.MatchesPassword(password) {
122122
if auth.hiddenDomain != "" &&
123-
(req.Host == auth.hiddenDomain || req.URL.Host == auth.hiddenDomain) {
123+
(matchHiddenDomain(req.Host, auth.hiddenDomain) || matchHiddenDomain(req.URL.Host, auth.hiddenDomain)) {
124124
wr.Header().Set("Content-Length", strconv.Itoa(len([]byte(AUTH_TRIGGERED_MSG))))
125125
wr.Header().Set("Pragma", "no-cache")
126126
wr.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")

0 commit comments

Comments
 (0)