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

http: PRI upgrade should return PAUSED_H2_UPGRADE #95

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
1 change: 1 addition & 0 deletions src/llhttp/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export enum ERROR {

PAUSED,
PAUSED_UPGRADE,
PAUSED_H2_UPGRADE,

USER,
}
Expand Down
6 changes: 4 additions & 2 deletions src/llhttp/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,10 @@ export class HTTP {
.otherwise(p.error(ERROR.INVALID_VERSION, 'Expected CRLF after version'));

n('req_pri_upgrade')
.match('\r\n\r\nSM\r\n\r\n', p.error(ERROR.PAUSED_UPGRADE, 'Pause on PRI/Upgrade'))
.otherwise(p.error(ERROR.INVALID_VERSION, 'Expected HTTP/2 Connection Preface'));
.match('\r\n\r\nSM\r\n\r\n',
p.error(ERROR.PAUSED_H2_UPGRADE, 'Pause on PRI/Upgrade'))
.otherwise(
p.error(ERROR.INVALID_VERSION, 'Expected HTTP/2 Connection Preface'));
}

private buildHeaders(): void {
Expand Down
2 changes: 1 addition & 1 deletion test/request/method.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,5 +386,5 @@ SM
off=0 message begin
off=4 len=1 span[url]="*"
off=6 url complete
off=24 error code=22 reason="Pause on PRI/Upgrade"
off=24 error code=23 reason="Pause on PRI/Upgrade"
```