From c9293dd2d13b6401665bc749af89d332c05be42e Mon Sep 17 00:00:00 2001 From: Naikel Aparicio Date: Wed, 23 Dec 2015 12:23:51 -0430 Subject: [PATCH] Fixed bug when uploading several files and only the last one was considered. --- src/base/http/requestparser.cpp | 2 +- src/base/http/types.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/base/http/requestparser.cpp b/src/base/http/requestparser.cpp index eb26dbc5c..220272590 100644 --- a/src/base/http/requestparser.cpp +++ b/src/base/http/requestparser.cpp @@ -319,7 +319,7 @@ bool RequestParser::parseFormData(const QByteArray& data) ufile.type = disposition["content-type"]; ufile.data = data.mid(header_end + EOH.length()); - m_request.files[disposition["name"]] = ufile; + m_request.files.append(ufile); } else { m_request.posts[disposition["name"]] = QString::fromUtf8(data.mid(header_end + EOH.length())); diff --git a/src/base/http/types.h b/src/base/http/types.h index e86330fec..28743e83f 100644 --- a/src/base/http/types.h +++ b/src/base/http/types.h @@ -32,6 +32,7 @@ #include #include #include +#include typedef QMap QStringMap; @@ -70,7 +71,7 @@ namespace Http QStringMap headers; QStringMap gets; QStringMap posts; - QMap files; + QVector files; }; struct ResponseStatus