Browse Source

lowercase header names

cl-refactor
arkpar 10 years ago
parent
commit
ccd39728e9
  1. 2
      mix/HttpServer.cpp
  2. 4
      mix/qml/WebPreview.qml

2
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"));

4
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 = "<script>web3=parent.web3;BigNumber=parent.BigNumber;contracts=parent.contracts;</script>\n" + content;

Loading…
Cancel
Save