tool_formparse: accept digits in --form type= strings

Adjusted test 186 to verify.

Regression in 9664d5a547, shipped in 8.11.1

Reported-by: IcedCoffeee on github
Assisted-by: Jay Satiro
Fixes #15761
Closes #15762
This commit is contained in:
Daniel Stenberg 2024-12-17 07:52:06 +01:00
parent fd067bfb5b
commit f7e065f314
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 6 additions and 5 deletions

View file

@ -495,14 +495,15 @@ static int get_param_part(struct OperationConfig *config, char endchar,
;
if(!endct && checkprefix("type=", p)) {
size_t tlen;
for(p += 5; ISSPACE(*p); p++)
;
/* set type pointer */
type = p;
/* find end of content-type */
while(*p && (ISALPHA(*p) || (*p == '/') || (*p == '-')))
p++;
tlen = strcspn(p, "()<>@,;:\\\"[]?=\r\n ");
p += tlen;
endct = p;
sep = *p;
}