Skip to content

Commit

Permalink
parser: add properties for lenient_transfer_encoding & lenient_version
Browse files Browse the repository at this point in the history
For the semantics of these new flags, see
* nodejs/llhttp#161 Chunked transfer encoding
* nodejs/llhttp#157 http: validate HTTP version
  • Loading branch information
pallas committed Aug 3, 2022
1 parent 395516b commit 1d104f9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pyllhttp.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ parser_set_lenient_ ## name(PyObject *self, PyObject *value, void *closure) \
LENIENT_FLAG(HEADERS);
LENIENT_FLAG(CHUNKED_LENGTH);
LENIENT_FLAG(KEEP_ALIVE);
LENIENT_FLAG(TRANSFER_ENCODING);
LENIENT_FLAG(VERSION);

static PyObject *
parser_get_lenient_headers(PyObject *self, void *closure) {
Expand Down Expand Up @@ -408,6 +410,8 @@ static PyGetSetDef parser_getset[] = {
{ "lenient_headers", parser_get_lenient_HEADERS, parser_set_lenient_HEADERS },
{ "lenient_chunked_length", parser_get_lenient_CHUNKED_LENGTH, parser_set_lenient_CHUNKED_LENGTH },
{ "lenient_keep_alive", parser_get_lenient_KEEP_ALIVE, parser_set_lenient_KEEP_ALIVE },
{ "lenient_transfer_encoding", parser_get_lenient_TRANSFER_ENCODING, parser_set_lenient_TRANSFER_ENCODING },
{ "lenient_version", parser_get_lenient_VERSION, parser_set_lenient_VERSION },
{ "message_needs_eof", parser_message_needs_eof },
{ "should_keep_alive", parser_should_keep_alive },
{ "is_paused", parser_is_paused },
Expand Down

0 comments on commit 1d104f9

Please sign in to comment.