1
0
Fork 0
mirror of https://github.com/thoughtbot/capybara-webkit synced 2023-03-27 23:22:28 -04:00

capturing status code restrict to page request

This commit is contained in:
shogo-ohta 2011-08-23 16:02:37 +09:00
parent 88b70e37a3
commit 41c842edf7

View file

@ -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() {