Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

constants: add | to list of allowed URL chars #24

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/llhttp/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export const STRICT_URL_CHAR: CharList = ([
':', ';', '<', '=', '>',
'@', '[', '\\', ']', '^', '_',
'`',
'{', '}', '~',
'{', '|', '}', '~',
] as CharList).concat(ALPHANUM);

export const URL_CHAR: CharList = STRICT_URL_CHAR
Expand Down
20 changes: 20 additions & 0 deletions test/request/uri.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,26 @@ off=51 headers complete method=1 v=1/1 flags=0 content_length=0
off=51 message complete
```

## Query URL with vertical bar character

It should be allowed to have vertical bar symbol in URI: `|`.

See: https://github.com/nodejs/node/issues/27584

<!-- meta={"type": "request"} -->
```http
GET /test.cgi?query=| HTTP/1.1


```

```log
off=0 message begin
off=4 len=17 span[url]="/test.cgi?query=|"
off=34 headers complete method=1 v=1/1 flags=0 content_length=0
off=34 message complete
```

## `host:port` terminated by a space

<!-- meta={"type": "request"} -->
Expand Down