Skip to content

tool_formparse: rewrite the headers file parser - #19113

Closed
bagder wants to merge 1 commit into
masterfrom
bagder/form-headers
Closed

tool_formparse: rewrite the headers file parser#19113
bagder wants to merge 1 commit into
masterfrom
bagder/form-headers

Conversation

@bagder

@bagder bagder commented Oct 18, 2025

Copy link
Copy Markdown
Member

The -F option allows users to provide a file with a set of headers for a specific formpost section. This code used old handcrafted parsing logic that potentially could do wrong.

Rewrite to use my_get_line() and dynbuf. Supports longer lines and should be more solid parsing code.

Gets somewhat complicated by the (unwise) feature that allows "folding" of header lines in the file: if a line starts with a space it should be appended to the previous.

The previous code trimmed spurious CR characters wherever they would occur in a line but this version does not. It does not seem like something we want or that users would expect.

Test 646 uses this feature.

The -F option allows users to provide a file with a set of headers for a
specific formpost section. This code used old handcrafted parsing logic
that potentially could do wrong.

Rewrite to use my_get_line() and dynbuf. Supports longer lines and
should be more solid parsing code.

Gets somewhat complicated by the (unwise) feature that allows "folding"
of header lines in the file: if a line starts with a space it should be
appended to the previous.

The previous code trimmed spurious CR characters wherever they would
occur in a line but this version does not. It does not seem like
something we want or that users would expect.

Test 646 uses this feature.
@github-actions github-actions Bot added the tests label Oct 18, 2025
@bagder
bagder marked this pull request as ready for review October 18, 2025 10:06
@bagder bagder closed this in f847d2e Oct 18, 2025
@bagder
bagder deleted the bagder/form-headers branch October 18, 2025 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant