diff options
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); | 
