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

Can't post formdata ;type= with number #15761

Closed
IcedCoffeee opened this issue Dec 17, 2024 · 1 comment
Closed

Can't post formdata ;type= with number #15761

IcedCoffeee opened this issue Dec 17, 2024 · 1 comment

Comments

@IcedCoffeee
Copy link

IcedCoffeee commented Dec 17, 2024

I did this

curl -X POST -F "file=@video.mp4;type=video/mp4" https://example.com
curl: (26) Failed to open/read local data from file/application

and

curl -F "data=test;type=test/test1" https://example.com
Warning: garbage at end of field specification: 1

however, removing the number in either of the types stops that error from occurring and uploads the file/data as expected.

I expected the following

This used to work, but from searching around a bit, I think this is what's causing the issue

while(*p && (ISALPHA(*p) || (*p == '/') || (*p == '-')))

which got changed in 9664d5a and would explain why it stopped working recently.

curl/libcurl version

curl 8.11.1 (x86_64-pc-linux-gnu) libcurl/8.11.1 OpenSSL/3.4.0 zlib/1.3.1 brotli/1.1.0 zstd/1.5.6 libidn2/2.3.7 libpsl/0.21.5 libssh2/1.11.0 nghttp2/1.64.0 nghttp3/1.6.0

operating system

Arch Linux

@bagder bagder self-assigned this Dec 17, 2024
@bagder
Copy link
Member

bagder commented Dec 17, 2024

That's my silly mistake. I'll fix.

bagder added a commit that referenced this issue Dec 17, 2024
Adjusted test 186 to verify.

Regression in 9664d5a, shipped in 8.11.1

Reported-by: IcedCoffeee on github
Fixes #15761
@bagder bagder closed this as completed in f7e065f Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants