summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRoland Stigge <stigge@antcom.de>2018-01-05 22:23:59 +0100
committerRoland Stigge <stigge@antcom.de>2018-01-05 22:23:59 +0100
commit6434919b9f2ac7cde18b724ef46f6a13207b3d85 (patch)
treeecaf6f622fd399d094904c3b0dd1c30f48994af9
parentf936478f7b5953b1fabeaa0605596ccdee8264e2 (diff)
Fix upload bug
-rw-r--r--TODO1
-rw-r--r--src/webbox.cpp7
2 files changed, 4 insertions, 4 deletions
diff --git a/TODO b/TODO
index ba7f43c..e062301 100644
--- a/TODO
+++ b/TODO
@@ -6,7 +6,6 @@ debian/
implement TBD features
handle spaces/umlauts
download zip
-Upload bug
Refresh
Prio 2 (for future versions)
diff --git a/src/webbox.cpp b/src/webbox.cpp
index 6378d5e..b5d35c2 100644
--- a/src/webbox.cpp
+++ b/src/webbox.cpp
@@ -255,16 +255,17 @@ int main(int argc, char* argv[]) {
} else {
QString contentType(FCGX_GetParam("CONTENT_TYPE", request.envp));
- if (!contentType.contains("boundary=--")) {
+ QString separator("boundary=");
+ if (!contentType.contains(separator)) {
FCGX_PutS(QString("No boundary defined").toUtf8().data(), request.out);
} else {
- QByteArray boundary = contentType.split("boundary=--")[1].toUtf8();
+ QByteArray boundary = QByteArray("--") + contentType.split(separator)[1].toUtf8();
int boundaryCount = content.count(boundary);
if (boundaryCount != 2) {
FCGX_PutS(QString("Bad boundary number found: %1").arg(boundaryCount).toUtf8().data(), request.out);
} else {
int start = content.indexOf(boundary) + boundary.size();
- int end = content.indexOf(boundary, start);
+ int end = content.indexOf(QByteArray("\r\n") + boundary, start);
content = content.mid(start, end - start);