From 36cc6909f844891b36f9f4d5b64f343550103a5c Mon Sep 17 00:00:00 2001 From: opengg Date: Fri, 10 Mar 2017 13:28:07 +0800 Subject: [PATCH] [WebUI] bugfix: `RequestParser::splitMultipartData` drop extra trailing newline. --- src/base/http/requestparser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/base/http/requestparser.cpp b/src/base/http/requestparser.cpp index 7f3ab1be7..a66a81666 100644 --- a/src/base/http/requestparser.cpp +++ b/src/base/http/requestparser.cpp @@ -198,14 +198,14 @@ QList RequestParser::splitMultipartData(const QByteArray& data, cons start = end + sepLength; // skip first boundary while ((end = data.indexOf(sep, start)) >= 0) { - ret << data.mid(start, end - start); + ret << data.mid(start, end - EOL.length() - start); start = end + sepLength; } // last or single part sep = boundary + "--" + EOL; if ((end = data.indexOf(sep, start)) >= 0) - ret << data.mid(start, end - start); + ret << data.mid(start, end - EOL.length() - start); } return ret;