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 parsing updates for RFC 9112 #155

Merged
merged 7 commits into from
May 21, 2024
Merged

HTTP parsing updates for RFC 9112 #155

merged 7 commits into from
May 21, 2024

Conversation

notroj
Copy link
Owner

@notroj notroj commented May 20, 2024

No description provided.

notroj added 5 commits May 20, 2024 20:56
space; reject various invalid chunk-size lines.

* src/ne_request.c (read_message_line): New function.
  (read_response_block): Stricter chunk-line parsing.
  (read_status_line, read_message_header): Use read_message_line.
  (strip_eol): Removed function.

* test/request.c (response_bodies, response_headers): Add tests
  for plain CR parsing.
  (fail_on_invalid): Add invalid chunked responses, add debugging.
  (ipv6_literal): Simplify.
  status-line.
  (ne_begin_request): Simplify, assume HTTP major version is 1.

* test/request.c (fail_on_invalid): Test for non-HTTP/1.x responses.
* src/ne_request.c: Add table_http_token lookup table.
  (read_response_headers): Use it to parse a token as the
  field-name. Don't allow whitespace BEFORE the colon.

* src/mktable.c (gen_token, main): New generator.

* test/request.c (response_headers, fail_on_invalid):
  New tests for valid/invalid response headers.
@notroj notroj force-pushed the http-parsing-rfc9112 branch from df3319a to 538851c Compare May 21, 2024 16:17
notroj added 2 commits May 21, 2024 19:20
no effect but can be used to relax any HTTP parsing strictness as
required for interoperability.

* src/ne_session.h (ne_session_flag): Add NE_SESSFLAG_STRICT.

* src/ne_session.c (ne_session_create): Enable NE_SESSFLAG_STRICT by
  default.
@notroj notroj merged commit bd8f1bb into master May 21, 2024
@notroj notroj deleted the http-parsing-rfc9112 branch May 21, 2024 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant