Отвечать 400 и 401 вместо 500 на NUL и невалидный UTF-8 во входных данных

This commit is contained in:
2026-10-06 15:41:36 +03:00
parent 8f9252a5c1
commit 3001507ecb
10 changed files with 34 additions and 5 deletions
+2
View File
@@ -54,6 +54,8 @@ func TestLoginFailuresAreUniformBasicChallenges(t *testing.T) {
"bearer scheme": {"Authorization": "Bearer " + strings.Repeat("A", 43)},
"not base64": {"Authorization": "Basic !!!"},
"no colon": {"Authorization": "Basic " + encoded("alice")},
"nul username": basic("a\x00b", testPassword),
"non-utf-8 name": basic("\xff\xfe", testPassword),
}
messages := map[string]string{}
for name, headers := range cases {