Commit 897f34f2 authored by lars's avatar lars
Browse files

Fix a crash when a request from the plugin resulted

        in a HTTP redirect.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@23520 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 30e48ce7
......@@ -454,12 +454,17 @@ void QWebNetworkManager::started(QWebNetworkJob *job)
QString location = job->d->response.value("location");
DEBUG() << "Redirection";
if (!location.isEmpty()) {
ResourceRequest newRequest = job->d->resourceHandle->request();
newRequest.setURL(KURL(newRequest.url(), DeprecatedString(location)));
if (client)
client->willSendRequest(job->d->resourceHandle, newRequest, response);
job->d->request.httpHeader.setRequest(job->d->request.httpHeader.method(), newRequest.url().path() + newRequest.url().query());
job->d->request.setURL(QString(newRequest.url().url()));
QUrl newUrl = job->d->request.url.resolved(location);
if (job->d->resourceHandle) {
ResourceRequest newRequest = job->d->resourceHandle->request();
newRequest.setURL(KURL(newUrl.toString()));
if (client)
client->willSendRequest(job->d->resourceHandle, newRequest, response);
}
job->d->request.httpHeader.setRequest(job->d->request.httpHeader.method(),
newUrl.toEncoded(QUrl::RemoveScheme|QUrl::RemoveAuthority));
job->d->request.setURL(newUrl);
job->d->redirected = true;
return;
}
......
2007-06-14 Lars Knoll <lars@trolltech.com>
Reviewed by George
Fix a crash when a request from the plugin resulted
in a HTTP redirect.
* Api/qwebnetworkinterface.cpp:
(QWebNetworkManager::started):
2007-06-14 Lars Knoll <lars@trolltech.com>
Reviewed by George.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment