2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-20 20:00:40 +03:00

fix(headers): fixed isValidHeaderName to support full list of allowed characters; (#5584)

This commit is contained in:
Dmitriy Mozgovoy
2023-03-19 15:30:51 +02:00
committed by GitHub
parent 2e70cecda4
commit e7decef6a9
+1 -3
View File
@@ -29,9 +29,7 @@ function parseTokens(str) {
return tokens; return tokens;
} }
function isValidHeaderName(str) { const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
return /^[-_a-zA-Z]+$/.test(str.trim());
}
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
if (utils.isFunction(filter)) { if (utils.isFunction(filter)) {