Commit 724ee47b authored by lars's avatar lars
Browse files

Fix Host: line in HTTP headers and resolving of relative URLs

when redirecting and clean up qHash forward declaration a bit.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@21662 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0645bc22
......@@ -21,10 +21,6 @@
pages from the web. It has a memory cache for these objects.
*/
#include <qglobal.h>
namespace WebCore {
class HostInfo;
}
uint qHash(const WebCore::HostInfo &info);
#include "qwebnetworkinterface.h"
#include "qwebnetworkinterface_p.h"
#include <qdebug.h>
......@@ -53,7 +49,7 @@ void QWebNetworkJobPrivate::setURL(const QUrl &u)
{
url = u;
int port = url.port();
if (port && port != 80)
if (port > 0 && port != 80)
request.setValue(QLatin1String("Host"), url.host() + QLatin1Char(':') + QString::number(port));
else
request.setValue(QLatin1String("Host"), url.host());
......@@ -300,7 +296,7 @@ void QWebNetworkManager::started(QWebNetworkJob *job)
DEBUG() << "Redirection";
if (!location.isEmpty()) {
ResourceRequest newRequest = job->d->resourceHandle->request();
newRequest.setURL(DeprecatedString(location));
newRequest.setURL(KURL(newRequest.url(), DeprecatedString(location)));
client->willSendRequest(job->d->resourceHandle, newRequest, response);
job->d->request.setRequest(job->d->request.method(), newRequest.url().path() + newRequest.url().query());
job->d->setURL(QString(newRequest.url().url()));
......
......@@ -24,6 +24,11 @@
#include "qwebnetworkinterface.h"
#include <qthread.h>
namespace WebCore {
struct HostInfo;
};
uint qHash(const WebCore::HostInfo &info);
#include <qhash.h>
namespace WebCore {
......@@ -121,7 +126,6 @@ namespace WebCore {
int port;
};
class WebCoreHttp : public QObject
{
Q_OBJECT
......
2007-05-23 Lars Knoll <lars@trolltech.com>
Reviewed by Simon.
* Api/qwebnetworkinterface.cpp:
(QWebNetworkJobPrivate::setURL):
(QWebNetworkManager::started):
Fix Host: line in HTTP headers and resolving of relative URLs
when redirecting.
* Api/qwebnetworkinterface_p.h:
Clean up qHash forward declaration a bit.
2007-05-23 Simon Hausmann <hausmann@kde.org>
Reviewed by Zack.
......
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