From f8f1bac3f0df29e9a3103d385a0c5f9153a9eb66 Mon Sep 17 00:00:00 2001 From: Dyami Caliri Date: Mon, 7 Mar 2016 20:27:09 -0800 Subject: Accept LFCRLF to mark end of HTTP Headers Some embedded servers use LF to mark the end of an individual header, but use CRLF to mark the end of all the headers. The GoPro WiFi interface does this, as an example. Change-Id: I227ab73622c84f439a6cf8703d020393c4d8bf69 Reviewed-by: Marc Mutz Reviewed-by: Markus Goetz (Woboq GmbH) --- src/network/access/qhttpnetworkreply.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/network/access/qhttpnetworkreply.cpp') diff --git a/src/network/access/qhttpnetworkreply.cpp b/src/network/access/qhttpnetworkreply.cpp index a0f05523e3..f1b0a844c8 100644 --- a/src/network/access/qhttpnetworkreply.cpp +++ b/src/network/access/qhttpnetworkreply.cpp @@ -554,9 +554,8 @@ qint64 QHttpNetworkReplyPrivate::readHeader(QAbstractSocket *socket) if (c == '\n') { // check for possible header endings. As per HTTP rfc, // the header endings will be marked by CRLFCRLF. But - // we will allow CRLFCRLF, CRLFLF, LFLF - if (fragment.endsWith("\r\n\r\n") - || fragment.endsWith("\r\n\n") + // we will allow CRLFCRLF, CRLFLF, LFCRLF, LFLF + if (fragment.endsWith("\n\r\n") || fragment.endsWith("\n\n")) allHeaders = true; -- cgit v1.2.3