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

NOT COMPLIANT WITH RFC FORMAT #20

Open
cheneydeng opened this issue Aug 7, 2014 · 8 comments · May be fixed by #28
Open

NOT COMPLIANT WITH RFC FORMAT #20

cheneydeng opened this issue Aug 7, 2014 · 8 comments · May be fixed by #28

Comments

@cheneydeng
Copy link

hi all,
I found that you guys have not understand what the format of multipart/form-data, the boundary is not as the same as it show in the body.Say we got the boundary in the HTTP header,as "--xxyy",then the "boundary part" in the body is
--boundary =====> ----xxyy.
and the last "boundary" =====> --boundary-- ======> --xxyy--
you misunderstand this and it will cause your code parse the data incorrectly.

@jamesamcl
Copy link
Contributor

Are you sure? Isn't that what s_part_data_final_hyphen is for?

@andrzej-bieniek
Copy link

I verified with curl, and "boundary part" in the body is additionally prefixed with "--".
@udp s_part_data_final_hyphen handles "--" suffix but not prefix.

$ curl -X POST -F name=John http://localhost:2000
Sends:

POST / HTTP/1.1
User-Agent: curl/7.35.0
Host: localhost:2000
Accept: */*
Content-Length: 143
Expect: 100-continue
Content-Type: multipart/form-data; boundary=------------------------adcf844310cc278d

--------------------------adcf844310cc278d
Content-Disposition: form-data; name="name"

John
--------------------------adcf844310cc278d--

Comparing boundary values:

  ------------------------adcf844310cc278d    (from Content-Type)
--------------------------adcf844310cc278d    (from body)
--------------------------adcf844310cc278d--  (from body)

@c1tru55
Copy link

c1tru55 commented Mar 21, 2015

Don't know how it is

Tested as part of Cosmonaut HTTP server.

but code logic is wrong and @cheneydeng absolutely right. Surprisingly that such serious bug still not fixed...

it will cause your code parse the data incorrectly.

in my case it doesn't work at all...

@iafonov
Copy link
Owner

iafonov commented Mar 21, 2015

@c1tru55 feel free to fork and fix. I don't use it anymore and Cosmonaut was pet project never used in real application

@twxjyg
Copy link

twxjyg commented Aug 19, 2016

I found this bug yet ...

@MrBuddyCasino
Copy link

Just found this bug as well. Please at least add a hint to your readme.

@zhengw1024
Copy link

not rfc standard

@egor-spk egor-spk linked a pull request Jul 23, 2020 that will close this issue
@ghost
Copy link

ghost commented Aug 25, 2022

Hi!
Is this commit actual?

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

Successfully merging a pull request may close this issue.

8 participants