diff --git a/mix/HttpServer.cpp b/mix/HttpServer.cpp index ba03d7795..fa09f51d0 100644 --- a/mix/HttpServer.cpp +++ b/mix/HttpServer.cpp @@ -156,7 +156,7 @@ void HttpServer::readClient() //collect headers int colon = l.indexOf(':'); if (colon > 0) - headers[l.left(colon)] = l.right(l.length() - colon - 1); + headers[l.left(colon).trimmed().toLower()] = l.right(l.length() - colon - 1).trimmed(); } while (!(l.isEmpty() || l == "\r" || l == "\r\n")); diff --git a/mix/qml/WebPreview.qml b/mix/qml/WebPreview.qml index df14d0c4f..e4d0b61a5 100644 --- a/mix/qml/WebPreview.qml +++ b/mix/qml/WebPreview.qml @@ -185,8 +185,8 @@ Item { content = fileIo.readFile(doc.path); } - var accept = _request.headers["Accept"]; - if (accept && accept.indexOf("text/html") >= 0 && !_request.headers["HTTP_X_REQUESTED_WITH"]) + var accept = _request.headers["accept"]; + if (accept && accept.indexOf("text/html") >= 0 && !_request.headers["http_x_requested_with"]) { //navigate to page request, inject deployment script content = "\n" + content;