-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
EQEmu/Server
#2442Labels
Description
Description:
when handling multipart/form-data content, function httplib::detail::MultipartFormDataParser::parse()
will fail contents that does not start with the boundary delimiter (line #3798).
Lines 3796 to 3798 in caa31aa
auto pattern = dash_ + boundary_ + crlf_; | |
if (pattern.size() > buf_size()) { return true; } | |
if (!buf_start_with(pattern)) { return false; } |
example multipart/form-data content:
\r\n\r\n------53014704754052338\r\nContent-Disposition: form-data; name=\"file\"; filename=\"346ba067e51efc5f.jpg\"\r\nContent-Type: image/jpeg\r\n\r\n\377\330\377............
Above form-data work perfectly with other websites.
However, I think RFC 2046 acquiesce CRLF preceding the boundary delimiter line
The CRLF preceding the boundary delimiter line is conceptually
attached to the boundary
Is this a bug? Or I misunderstand how boundary delimiter works?
Possible fix:
maybe left trim all the CRLFs before parsing form-data?