Skip to content

Commit c0938af

Browse files
committed
cleaner headers for an "auth triggered" messages
1 parent bf0f5c1 commit c0938af

2 files changed

Lines changed: 0 additions & 4 deletions

File tree

auth/hmac.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,9 @@ func (auth *HMACAuth) Validate(ctx context.Context, wr http.ResponseWriter, req
128128
if VerifyHMACLoginAndPassword(auth.secret, login, password) {
129129
if auth.hiddenDomain != "" &&
130130
(matchHiddenDomain(req.Host, auth.hiddenDomain) || matchHiddenDomain(req.URL.Host, auth.hiddenDomain)) {
131-
wr.Header().Set("Content-Length", strconv.Itoa(len([]byte(AUTH_TRIGGERED_MSG))))
132131
wr.Header().Set("Pragma", "no-cache")
133132
wr.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
134133
wr.Header().Set("Expires", EPOCH_EXPIRE)
135-
wr.Header()["Date"] = nil
136134
wr.WriteHeader(http.StatusOK)
137135
wr.Write([]byte(AUTH_TRIGGERED_MSG))
138136
return "", false

auth/redis.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,9 @@ func (auth *RedisAuth) Validate(ctx context.Context, wr http.ResponseWriter, req
121121
if matcher.MatchesPassword(password) {
122122
if auth.hiddenDomain != "" &&
123123
(matchHiddenDomain(req.Host, auth.hiddenDomain) || matchHiddenDomain(req.URL.Host, auth.hiddenDomain)) {
124-
wr.Header().Set("Content-Length", strconv.Itoa(len([]byte(AUTH_TRIGGERED_MSG))))
125124
wr.Header().Set("Pragma", "no-cache")
126125
wr.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
127126
wr.Header().Set("Expires", EPOCH_EXPIRE)
128-
wr.Header()["Date"] = nil
129127
wr.WriteHeader(http.StatusOK)
130128
wr.Write([]byte(AUTH_TRIGGERED_MSG))
131129
return "", false

0 commit comments

Comments
 (0)