-
Notifications
You must be signed in to change notification settings - Fork 158
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
QHTTP modifies POST boundary #32
Comments
Re: header fields: ”Each header field consists of a name followed by a colon (":") and the field value. Field names are case-insensitive.” |
Correct, field names are case-insensitive. But field values are not case-insensitive |
I was just going to file a report about this issue! Long story short, to get it to work simply remove .toLower() for all header values in the qhttp code and it will work as expected (.toLower() on header key is fine as is). And for you guys who don't understand the problem that is being addressed, here is an attempt to explain it: When doing HTTP POST with "multipart/form-data" to upload a file with some parameters the client will prepare a header in the request like this:
The POST body will then contain the Any file uploads with all modern browsers will use this method. As an example, the boundary string that Google Chrome generates when posting a file looks like this: "----WebKitFormBoundarySbQGNFBMdCG2vf0J". Notice that this boundary string contains mixed case data! If the header value is made toLower(), this boundary string will be useless, because the boundary string used to separate parts of the POST body will still be mixed case. I don't know if it is a standard violation or not, but it sure as hell breaks a pretty basic feature of HTTP POST- namely the use of boundaries to separate the fields of the uploaded data:-) |
stumbled over the same issue right now why is this not gonna be fixed? It's as simple as removing the toLower() and it does not break any convention. Matching the boundary case insensitive might be a solution too. |
Hi. I use a great QHTTP library as a HTTP server implementation. When I receive a POST multipart/form-data request I get its boundary from the "content-type" header. However I noticed, that the HTTP header value is altered and is modified to be in a lower case (HTTP standard violation?). Because of that I cannot find the received boundary in a POSTed data.
The text was updated successfully, but these errors were encountered: