diff options
author | Morten Sorvig <msorvig@trolltech.com> | 2009-08-06 06:18:29 +0200 |
---|---|---|
committer | Morten Sorvig <msorvig@trolltech.com> | 2009-08-06 06:18:29 +0200 |
commit | dc8d69e7939546390a890902edae2ffe7682d920 (patch) | |
tree | bd4f842841a8a5550a921f5cb71b04d27cb32ccd /src | |
parent | 4746918d1c201259351ced410329edb50d7f4cce (diff) |
url decode the GET/POST line
Diffstat (limited to 'src')
-rw-r--r-- | src/webclientserver.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/webclientserver.cpp b/src/webclientserver.cpp index 37a7f86..664e04e 100644 --- a/src/webclientserver.cpp +++ b/src/webclientserver.cpp @@ -44,9 +44,11 @@ void HttpRequest::readText() void HttpRequest::parseText() { foreach (const QByteArray &line, m_text) { - if (line.startsWith("GET")) { - m_path = line.mid(4).split(' ').at(0); // ### assumes well-formed string - } else if (line.startsWith("Cookie:")) { + if (line.startsWith("GET")) { + m_path = QUrl::fromPercentEncoding(line.mid(4).split(' ').at(0)).toAscii(); // ### assumes well-formed string + } else if (line.startsWith("POST")) { + m_path = QUrl::fromPercentEncoding(line.mid(5).split(' ').at(0)).toAscii(); // ### assumes well-formed string + } else if (line.startsWith("Cookie:")) { // qDebug() << "cookie line" << line.simplified(); m_cookies = line.mid(7).simplified(); // remove "Cookie:" // qDebug() << "cookies text" << m_cookies; @@ -199,6 +201,8 @@ void Server::dataOnSocket() bytesRead += line.count(); } +// DEBUG << lines; + HttpRequest request(lines); int sessionId = 0; |