Permalink
Browse files

capturing status code restrict to page request

  • Loading branch information...
os0x committed Aug 23, 2011
1 parent 88b70e3 commit 41c842edf7584cad66af342a2329199bc24778d1
Showing with 10 additions and 8 deletions.
  1. +10 −8 src/WebPage.cpp
View
@@ -168,16 +168,18 @@ QString WebPage::getLastAttachedFileName() {
}
void WebPage::replyFinished(QNetworkReply *reply) {
- QStringList headers;
- lastStatus = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
- QList<QByteArray> list = reply->rawHeaderList();
+ if (reply->url() == this->mainFrame()->url()) {
+ QStringList headers;
+ lastStatus = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
+ QList<QByteArray> list = reply->rawHeaderList();
- int length = list.size();
- for(int i = 0; i < length; i++) {
- headers << list.at(i)+": "+reply->rawHeader(list.at(i));
- }
+ int length = list.size();
+ for(int i = 0; i < length; i++) {
+ headers << list.at(i)+": "+reply->rawHeader(list.at(i));
+ }
- m_pageHeaders = headers.join("\n");
+ m_pageHeaders = headers.join("\n");
+ }
}
int WebPage::getLastStatus() {

0 comments on commit 41c842e

Please sign in to comment.