Skip to content

Commit

Permalink
wrap name in quotes to be able to identify empty strings as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Carmelo Patti authored and JakeChampion committed Dec 15, 2020
1 parent b72f02a commit a8aa427
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function normalizeName(name) {
name = String(name)
}
if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {
throw new TypeError('Invalid character in header field name: ' + name)
throw new TypeError('Invalid character in header field name: "' + name + '"')
}
return name.toLowerCase()
}
Expand Down

0 comments on commit a8aa427

Please sign in to comment.