Skip to content
Browse files

Response headers should be reset

  • Loading branch information...
1 parent 9c195af commit 482717484e1a3e67773f68a7c4ffea19099b3fb6 @os0x os0x committed
Showing with 8 additions and 7 deletions.
  1. +1 −1 src/Reset.cpp
  2. +5 −4 src/WebPage.cpp
  3. +2 −2 src/WebPage.h
View
2 src/Reset.cpp
@@ -13,7 +13,7 @@ void Reset::start(QStringList &arguments) {
page()->networkAccessManager()->setCookieJar(new QNetworkCookieJar());
page()->setCustomNetworkAccessManager();
page()->setUserAgent(NULL);
- page()->resetLastStatus();
+ page()->resetResponseHeaders();
emit finished(new Response(true));
}
View
9 src/WebPage.cpp
@@ -173,7 +173,7 @@ QString WebPage::getLastAttachedFileName() {
void WebPage::replyFinished(QNetworkReply *reply) {
if (reply->url() == this->currentFrame()->url()) {
QStringList headers;
- lastStatus = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
+ m_lastStatus = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
QList<QByteArray> list = reply->rawHeaderList();
int length = list.size();
@@ -186,11 +186,12 @@ void WebPage::replyFinished(QNetworkReply *reply) {
}
int WebPage::getLastStatus() {
- return lastStatus;
+ return m_lastStatus;
}
-void WebPage::resetLastStatus() {
- lastStatus = 0;
+void WebPage::resetResponseHeaders() {
+ m_lastStatus = 0;
+ m_pageHeaders = QString();
}
QString WebPage::pageHeaders() {
View
4 src/WebPage.h
@@ -11,7 +11,7 @@ class WebPage : public QWebPage {
QString userAgentForUrl(const QUrl &url ) const;
void setUserAgent(QString userAgent);
int getLastStatus();
- void resetLastStatus();
+ void resetResponseHeaders();
void setCustomNetworkAccessManager();
bool render(const QString &fileName);
virtual bool extension (Extension extension, const ExtensionOption *option=0, ExtensionReturn *output=0);
@@ -40,7 +40,7 @@ class WebPage : public QWebPage {
QString getLastAttachedFileName();
void loadJavascript();
void setUserStylesheet();
- int lastStatus;
+ int m_lastStatus;
QString m_pageHeaders;
};

0 comments on commit 4827174

Please sign in to comment.
Something went wrong with that request. Please try again.