-
Notifications
You must be signed in to change notification settings - Fork 122
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
MultiData parsing doesn't handle preamble properly #86
Comments
Is this not just a Nim stdlib issue? |
Since Jester fails for valid HTTP, I'd say it's Jester issue in the first place. |
More information here: dom96/jester#86
I can no longer reproduce this, has it been fixed? |
I can confirm as well that the initial example works. I suspect it was fixed on client side by this PR: nim-lang/Nim#5711 . Jester still seems to choke on preamble, though: Server: import jester, asyncdispatch
from nativesockets import Port
settings:
port = Port(1234)
bindAddr = "127.0.0.1"
routes:
post "/mp":
let fd = request.formData
assert fd.hasKey("foo")
resp("OK")
runForever() Http request: POST /mp HTTP/1.1
Host: localhost
Content-Type: multipart/form-data; boundary=XX
Content-Length: 66
--XX
Content-Disposition: form-data; name="foo"
bar
--XX-- Sending this makes the server close the connection, though the program itself doesn't crash like before (at least on Windows). |
httpclient
overhaul triggered this bug in Jester. It now crashes on multipart message with non-empty preamble part.Example code:
This fails with the following error message:
Here's the reason: old (deprecated) and new
postContent
versions differ in HTTP they output; in particular the new version's output has an extra empty line before the first boundary. This line should be considered part of the preamble (as specified in RFC1341), and ignored.The text was updated successfully, but these errors were encountered: