Skip to content

Commit

Permalink
fix(headers): support HTTP2 pseudo-headers
Browse files Browse the repository at this point in the history
which begin with `:` e.g. `:authority`, `:method`, etc.
  • Loading branch information
pcattori committed Dec 5, 2023
1 parent 68fb00e commit 6e0c9d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/wise-dogs-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/web-fetch": patch
---

Support HTTP2 pseudo-headers like `:authority`, `:method`, etc.
2 changes: 1 addition & 1 deletion packages/fetch/src/headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const validators = (http)
* @param {string} name
*/
const validateHeaderName = name => {
if (!/^[\^`\-\w!#$%&'*+.|~]+$/.test(name)) {
if (!/^[\^`\-\w!#$%&'*+.|~:]+$/.test(name)) {
const err = new TypeError(`Header name must be a valid HTTP token [${name}]`);
Object.defineProperty(err, 'code', {value: 'ERR_INVALID_HTTP_TOKEN'});
throw err;
Expand Down

0 comments on commit 6e0c9d5

Please sign in to comment.