diff options
author | Roland Stigge <stigge@antcom.de> | 2018-01-05 22:23:59 +0100 |
---|---|---|
committer | Roland Stigge <stigge@antcom.de> | 2018-01-05 22:23:59 +0100 |
commit | 6434919b9f2ac7cde18b724ef46f6a13207b3d85 (patch) | |
tree | ecaf6f622fd399d094904c3b0dd1c30f48994af9 /src | |
parent | f936478f7b5953b1fabeaa0605596ccdee8264e2 (diff) |
Fix upload bug
Diffstat (limited to 'src')
-rw-r--r-- | src/webbox.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
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); |