Bug 188435

Summary: Konqueror redirects from http://url.com/path1 to http://url.com:80/path2 for at least 301 and 302 HTTP redirects
Product: [Applications] konqueror Reporter: Artem S. Tashkinov <aros>
Component: generalAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED DUPLICATE    
Severity: normal CC: mpartap
Priority: NOR    
Version: 4.2.1   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Artem S. Tashkinov 2009-03-30 00:31:39 UTC
Version:            (using KDE 4.2.1)
OS:                Linux
Installed from:    Fedora RPMs

The simplest example:

open http://www.veryicon.com/icon/bah-bz2.html in Konqueror, it will redirect to http://www.veryicon.com:80/icons/file-type/archives/bah-bz2.html

Mind the [:80] part of the new URL.

Consequences:
1) KWallet authentication fails.
2) Referrer information breaks.
3) History gets filled with erroneous entries.

This problem is often visible on sites which redirect upon authentication.

I can report other websites which cause such misbehaviour.

telnet session shows no problems and no explicit port direction:

telnet www.veryicon.com 80
Trying 74.53.9.254...
Connected to www.veryicon.com.
Escape character is '^]'.
GET /icon/bah-bz2.html HTTP/1.0
Host: www.veryicon.com

HTTP/1.1 301 Moved Permanently
Date: Sun, 29 Mar 2009 22:16:31 GMT
Server: Apache/1.3.41 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_ssl/2.8.31 OpenSSL/0.9.7a
X-Powered-By: PHP/5.2.6
location: /icons/file-type/archives/bah-bz2.html
Connection: close
Content-Type: text/html

Connection closed by foreign host.

Having investigated this bug for some time I found out that this problems happens for all sites which use HTTP code 301 redirection.

E.g. http://www.dmi.dk/dmi/mobil/ redirects to http://www.dmi.dk:80/dmi/mobil/mobil/til_lands.htm.

This bug also occurs for 302 redirects:

GET / HTTP/1.1
Host: example.com
Connection: Keep-Alive
User-Agent: Mozilla/5.0 (compatible; Konqueror/4.2) KHTML/4.2.1 (like Gecko) Fedora/4.2.1-4.fc10
Accept: text/html, image/jpeg;q=0.9, image/png;q=0.9, text/*;q=0.9, image/*;q=0.9, */*;q=0.8
Accept-Encoding: x-gzip, x-deflate, gzip, deflate
Accept-Charset: utf-8, utf-8;q=0.5, *;q=0.5
Accept-Language: en-US, en

HTTP/1.1 302 Found
Date: Sun, 29 Mar 2009 22:28:16 GMT
Server: Apache/2.2.10
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Location: login.shtml
Content-Length: 0
Connection: close

In this case Konqueror redirects to http://example.com:80/login.shtml
Comment 1 Tommi Tervo 2009-03-30 08:25:34 UTC

*** This bug has been marked as a duplicate of bug 171256 ***
Comment 2 Marcel Partap 2009-06-21 19:41:49 UTC
This test case seems to work on latest SVN, also have not seen recently the problem this is marked as duplicate of..