Bug 61235 - konqueror refuses http redirect to same location
Summary: konqueror refuses http redirect to same location
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml (show other bugs)
Version: unspecified
Platform: Debian stable Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
: 130573 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-07-14 19:56 UTC by Georg Baum
Modified: 2009-12-11 20:08 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
php file to test this bug (422 bytes, application/x-php)
2004-12-23 20:23 UTC, Georg Baum
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Georg Baum 2003-07-14 19:56:22 UTC
Version:            (using KDE KDE 3.1.3)
Installed from:    Debian stable Packages
OS:          Linux

If I try to visit a page that redirects to itself via the http 302 Location: header, konqueror refuses to load the page a second time and displays the error message

"Beim Laden von http://www.example.com/ ist folgender Fehler aufgetreten:
Auf sich selbst verweisende Verkn
Comment 1 Georg Baum 2004-05-10 18:49:09 UTC
The bug is still there with kde 3.2.1. It is sometimes occuring with http://groups.yahoo.com/group/groupname/message/number, where groupname is a yahoo group and number a message number.
Comment 2 Stephan Kulow 2004-11-04 19:44:25 UTC
you don't happen to have a working URL?
Comment 3 Georg Baum 2004-12-23 20:23:58 UTC
Created attachment 8795 [details]
php file to test this bug

No, I have no working URL. Yahoo rearranged their URLs, and we created a
workaround on our internal site.
But you can test this bug with the attached php file. Put it on a web server,
and load it. Don't allow the cookie to be set, and you'll get the described
behavior. I tested it with konqueror 3.3.1, and the error message came after
several reloads and not on the first time, so this problem is fixed and the
behavior fine now.
However, if you comment the header() line and uncomment the three echo lines,
the reloading check is not performed at all. IMHO the behavior should be the
same wether the redirect works via http headers or html meta tags.
Comment 4 Mathias Homann 2006-07-10 21:41:57 UTC
a test case where this bug happens is http://www.megatokyo.de/?id=106
but strange enough it happens only when the redirect target contains german umlauts.

here's the curl -I output for that url:
HTTP/1.1 302 Found
X-Powered-By: PHP/5.1.4
Set-Cookie: MegaTokyoID=AURpLCwiAfE=; expires=Tue, 10 Jul 2007 19:36:38 GMT; path=/
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
Content-Type: text/html;charset=UTF-8
Content-Language: de
Location: http://www.megatokyo.de/comic/de0106/ping-das-ps2-zubehör
Content-Length: 0
Date: Mon, 10 Jul 2006 19:36:38 GMT
Server: lighttpd/1.4.11
Connection: close

Comment 5 Bjorge Dijkstra 2006-08-22 23:28:35 UTC
I cannot reproduce effects mentioned in comment #3 with konq 3.5.4.
So probably all fixed now?

The redirect error on url mentioned above in comment #4 is a real redirect loop (verified with ethereal trace). Konqueror does not seem to notice the Location: header is already UTF8 encoded and tries to UTF8 encode the url in the header again and thus corrupting it. This combined with some server smarts trying to redirect konqueror back to the correct page leads to a loop.
But that should maybe be a seperate bug from this one.
Comment 6 Mathias Homann 2006-08-27 11:56:55 UTC
so, should i open a separate one for megatokyo?
Comment 7 Louai Al-Khanji 2006-08-30 14:00:37 UTC
Can reproduce none of the issues above, everything seems to work fine. KDE 3.5.4, Kubuntu Dapper.
Comment 8 lexual 2006-08-30 14:16:21 UTC
closing worksforme
Comment 9 Mathias Homann 2006-08-30 14:25:24 UTC
of course http://www.megatokyo.de/comic/de0106/ping-das-ps2-zubehör works now, since lapo (the webmaster) made a workaround especially for konqueror...
Comment 10 Mathias Homann 2006-09-05 10:09:18 UTC
still broken: http://www.megatokyo.it/k-bug.php is a testcase.
Comment 11 Michal Witkowski 2008-09-29 01:28:02 UTC
I'm having a similar problem in KDE 4.1.1, though I don't know if it's of the same origin.

On my private web server I have a small,simple php gallery script which generates thumbnails (and caches them later) on the fly. Thus, handling a large number of thumbnail generation requests (ie. first time views) at the same time is not possible. This results in missing images in the picture listing in konqueror, though firefox and IE work well.

I've established that the apache2 server, when it can't handle the request right now, sends 302 Found message and expects the browser to request the image later. Konqueror doesn't do this and simply draws the 'missing image' thing. As I said, firefox has no problems.

My web server says something like:
62.xx.xx.xx - user [29/Sep/2008:01:04:57 +0200] "GET /~user/photo/.scry/cache/Ustronie!IMG_0190_56x75.JPG HTTP/1.0" 200 1753 "http://xxx/~user/photo/index.php?v=list&i=0&p=Ustronie" "Mozilla/5.0 (compatible; Konqueror/4.1; Linux) KHTML/4.1.1 (like Gecko)"
62.xx.xx.xx - user [29/Sep/2008:01:04:58 +0200] "GET /~user/photo/index.php?v=image&i=100x75&p=Ustronie/IMG_0101.JPG HTTP/1.0" 302 - "http://xxx/~user/photo/index.php?v=list&i=0&p=Ustronie" "Mozilla/5.0 (compatible; Konqueror/4.1; Linux) KHTML/4.1.1 (like Gecko)"
62.xx.xx.xx - user [29/Sep/2008:01:04:58 +0200] "GET /~user/photo/.scry/cache/Ustronie!IMG_0102_100x75.JPG HTTP/1.0" 200 2120 "http://xxx/~user/photo/index.php?v=list&i=0&p=Ustronie" "Mozilla/5.0 (compatible; Konqueror/4.1; Linux) KHTML/4.1.1 (like Gecko)"
62.xx.xx.xx - user [29/Sep/2008:01:04:58 +0200] "GET /~user/photo/index.php?v=image&i=100x75&p=Ustronie/IMG_0104.JPG HTTP/1.0" 302 - "http://xxx/~user/photo/index.php?v=list&i=0&p=Ustronie" "Mozilla/5.0 (compatible; Konqueror/4.1; Linux) KHTML/4.1.1 (like Gecko)"
62.xx.xx.xx - user [29/Sep/2008:01:04:58 +0200] "GET /~user/photo/index.php?v=image&i=100x75&p=Ustronie/IMG_0103.JPG HTTP/1.0" 302 - "http://xxx/~user/photo/index.php?v=list&i=0&p=Ustronie" "Mozilla/5.0 (compatible; Konqueror/4.1; Linux) KHTML/4.1.1 (like Gecko)"
62.xx.xx.xx - user [29/Sep/2008:01:04:58 +0200] "GET /~user/photo/.scry/cache/Ustronie!IMG_0101_56x75.JPG HTTP/1.0" 200 1704 "http://xxx/~user/photo/index.php?v=list&i=0&p=Ustronie" "Mozilla/5.0 (compatible; Konqueror/4.1; Linux) KHTML/4.1.1 (like Gecko)"

Comment 12 Maksim Orlovich 2008-09-29 17:40:16 UTC
re: comment #11: please also see bug #171368.
Any chance you could get a wireshark log of the loop you're seeing (properly redacted, of course) --- it'd be interesting to see what the server sends a Location: for the 302.

Comment 13 Michal Witkowski 2008-09-29 18:43:35 UTC
Well it seems that it's not a bug related to http 302 after all. The script works a tid-bit differently from what I thought (php posts 302 Temporarily Moved with the Location of the cached image, thus forcing the browser to make 2 requests).

However, the problem now seems a bit different: konqueror sometimes does the full 2 requests, sometimes it only does the first one (getting the 302 but not the image) and sometimes fails to create a HTTP request for some images at all! The page is 1/3 populated with images and after that there are only images here and there. It seems as if konqueror runs out of kio_http processes to post the requests and after that fails without retrying. Anyone heard of a similar bug or shall I open a new one?
Comment 14 Maksim Orlovich 2008-09-29 18:58:56 UTC
Please do a separate report. I might have a guess as to what it is, but seems off-topic for this report now.
Comment 15 Michal Witkowski 2008-09-29 23:49:01 UTC
I've created a new bug report here: http://bugs.kde.org/show_bug.cgi?id=171878 I hope this gets fixed :) If there's anything more I can check, feel free to mail me.
Comment 16 Dawit Alemayehu 2009-12-11 19:08:42 UTC
SVN commit 1061440 by adawit:

- Workaround brain dead sites that return violate the spec and return 
  a 401 without a WWW-Authenticate header field.
- Correctly escape redirection urls that contain non-ascii/non-latin1
  characters.

BUG:61235
BUG:215736


 M  +96 -85    http.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1061440
Comment 17 Dawit Alemayehu 2009-12-11 20:08:44 UTC
*** Bug 130573 has been marked as a duplicate of this bug. ***