You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for adding the flag! The API surface (LENIENT_FLAGS.OPTIONAL_SP_AFTER_STATUS, llhttp_set_lenient_optional_sp_after_status, README) looks good and fits well with Node's lenient mode.
However, the lenient path doesn't work for the case it's meant to cover:
CR is not consumed. In src/llhttp/http.ts (around lines 396-404), when the flag is enabled any non-space character goes to res_line_almost_done without consuming the \r. That node expects the \n (the CR was already consumed by the old .match('\r', n('res_line_almost_done'))). So HTTP/1.1 301\r\n with the flag on still fails with Expected LF after CR, while a bare HTTP/1.1 301\n passes. In the lenient branch please keep the original matches: \r → res_line_almost_done, \n → checkIfAllowLFWithoutCR(...), otherwise error.
Missing tests for the flag.test/fixtures/index.ts doesn't register a response-lenient-optional-sp-after-status type, and there is no markdown test using it. Please add one covering at least HTTP/1.1 301\r\n (and \n together with OPTIONAL_LF_AFTER_CR). The request-... init in test/fixtures/extra.c can be dropped, since this only applies to the status line.
Also, CI on the current head is failing; please rebase/push so it runs again.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix nodejs/node#62193