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

Wrong output when parsing parameters in multipart form #4

Closed
salty-horse opened this issue Apr 11, 2018 · 3 comments
Closed

Wrong output when parsing parameters in multipart form #4

salty-horse opened this issue Apr 11, 2018 · 3 comments

Comments

@salty-horse
Copy link

salty-horse commented Apr 11, 2018

When several form parameters are provided, the output from h2c is garbled.

This curl command:
curl --form ONE=1 --form TWO=2 --form THREE=3 http://localhost:8000

Performs this request:

POST / HTTP/1.1
Host: localhost:8000
User-Agent: curl/7.47.0
Accept: */*
Content-Length: 327
Expect: 100-continue
Content-Type: multipart/form-data; boundary=------------------------48e1b0f105811e87

--------------------------48e1b0f105811e87
Content-Disposition: form-data; name="ONE"

1
--------------------------48e1b0f105811e87
Content-Disposition: form-data; name="TWO"

2
--------------------------48e1b0f105811e87
Content-Disposition: form-data; name="THREE"

3
--------------------------48e1b0f105811e87--

Which h2c outputs as:

curl --http1.1 --user-agent "curl/7.47.0" --form ONE=1 --form TWO=1
2 --form THREE=1
2
3 https://localhost:8000/

Note that the value of the form fields keeps accumulating instead of resetting. TWO's value is 1\n2 and THREE's value is 1\n2\n3.

@salty-horse salty-horse changed the title Error parsing parameters in multipart form Wrong output when parsing parameters in multipart form Apr 11, 2018
@bagder
Copy link
Member

bagder commented Apr 12, 2018

Regarding your last point, the page already says:

The generated command line assumes a HTTPS site and generates such a URL. There is typically nothing in the request that tells if HTTPS or HTTP was used.

I'll work on the bug...

@salty-horse
Copy link
Author

Sorry, I realized it later and edited the last sentences.
Please have a look at the latest report because I added some information.

@bagder bagder closed this as completed in e2ae23e Apr 12, 2018
@bagder
Copy link
Member

bagder commented Apr 12, 2018

Fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants