Skip to content

Conversation

@indutny
Copy link
Member

@indutny indutny commented Apr 20, 2021

PRI gets special treatment (parse preamble and error) and even though it
is parsed and allowed after HTTP/1.x - it is not technically a method
that could appear in the request parsed with llhttp. Remove the method
from the list of HTTP methods in C headers to prevent confusion and
breakage of body-parser.

See: #103 (comment)

C header changes

diff --git a/tmp/llhttp-old.h b/tmp/llhttp-new.h
index fd1fdb9..0b06170 100644
--- a/tmp/llhttp-old.h
+++ b/tmp/llhttp-new.h
@@ -231,7 +231,6 @@ typedef enum llhttp_method llhttp_method_t;
   XX(31, LINK, LINK) \
   XX(32, UNLINK, UNLINK) \
   XX(33, SOURCE, SOURCE) \
-  XX(34, PRI, PRI) \
 
 
 #define RTSP_METHOD_MAP(XX) \

cc @nodejs/http

PRI gets special treatment (parse preamble and error) and even though it
is parsed and allowed after `HTTP/1.x` - it is not technically a method
that could appear in the request parsed with llhttp. Remove the method
from the list of HTTP methods in C headers to prevent confusion and
breakage of `body-parser`.
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

indutny added a commit that referenced this pull request Apr 22, 2021
PRI gets special treatment (parse preamble and error) and even though it
is parsed and allowed after `HTTP/1.x` - it is not technically a method
that could appear in the request parsed with llhttp. Remove the method
from the list of HTTP methods in C headers to prevent confusion and
breakage of `body-parser`.

PR-URL: #105
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
@indutny
Copy link
Member Author

indutny commented Apr 22, 2021

Landed in 3f85eb7, thank you!

@indutny indutny closed this Apr 22, 2021
@indutny indutny deleted the fix/pri-listed branch April 22, 2021 16:33
@indutny
Copy link
Member Author

indutny commented Apr 22, 2021

Released in v6.0.1.

alex-dev-2012 added a commit to alex-dev-2012/llhttp that referenced this pull request Jul 29, 2025
PRI gets special treatment (parse preamble and error) and even though it
is parsed and allowed after `HTTP/1.x` - it is not technically a method
that could appear in the request parsed with llhttp. Remove the method
from the list of HTTP methods in C headers to prevent confusion and
breakage of `body-parser`.

PR-URL: nodejs/llhttp#105
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants