mirror of
https://github.com/curl/curl.git
synced 2026-08-25 02:53:32 +03:00
tool_formparse: rewrite the headers file parser
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. Closes #19113
This commit is contained in:
parent
f32451c12b
commit
f847d2ed02
2 changed files with 53 additions and 54 deletions
|
|
@ -42,7 +42,7 @@ It may contain any type of data.
|
|||
X-fileheader1: This is a header from a file
|
||||
|
||||
# This line is another comment. It precedes a folded header.
|
||||
X-fileheader2: This is
#a
|
||||
X-fileheader2: This is #a
|
||||
folded header
|
||||
</file2>
|
||||
</client>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue