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:
authorfeistel <6742251-feistel@users.noreply.gitlab.com>2021-07-08 14:54:53 +0300
committerfeistel <6742251-feistel@users.noreply.gitlab.com>2022-02-16 20:14:29 +0300
commitcd305d058d8cd82961034115d676281cca00436c (patch)
tree309f98b4b0a8ff7fd097a86f96dacef43b7dc77d /internal
parent6b8e43cc39b38d7932061f7d8864c075eeb41934 (diff)
test: fix failing tests
When passing invalid header keys (if it contains spaces or non-token bytes), the key is unchanged and a string copy is returned. Since tests expect trailing whitespaces in the header key to be stripped we need to do it manually instead of relying on CanonicalMIMEHeaderKey
Diffstat (limited to 'internal')
-rw-r--r--internal/customheaders/customheaders.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/internal/customheaders/customheaders.go b/internal/customheaders/customheaders.go
index f80d7f9a..4c2289e0 100644
--- a/internal/customheaders/customheaders.go
+++ b/internal/customheaders/customheaders.go
@@ -31,6 +31,7 @@ func ParseHeaderString(customHeaders []string) (http.Header, error) {
}
for k, v := range keyValue {
+ k = textproto.CanonicalMIMEHeaderKey(strings.TrimSpace(k))
headers[k] = append(headers[k], v...)
}
}