w3m icon indicating copy to clipboard operation
w3m copied to clipboard

Fix redirection check

Open rkta opened this issue 2 years ago • 2 comments

When doing a search on http://en.wikipedia.org w3m falsely claims to detect a redirection loop. This happens because Wikipedia does a 302 redirect where only the searchpart of the url (the part after the ?) differs.

Here are the parameters passed to same_url_p() when searching for w3m:

(gdb) p *pu1 $8 = {scheme = 13, user = 0x0, pass = 0x0, host = 0x7ffff762ec30 "en.wikipedia.org", port = 443, file = 0x7ffff762ec00 "/w/index.php", real_file = 0x0, query = 0x7ffff7530910 "search=w3m&title=Special%3ASearch&ns0=1", label = 0x0, is_nocache = 0} (gdb) p *pu2 $9 = {scheme = 13, user = 0x0, pass = 0x0, host = 0x7ffff762ef60 "en.wikipedia.org", port = 443, file = 0x7ffff762ef30 "/w/index.php", real_file = 0x0, query = 0x7ffff762eed0 "search=w3m&title=Special%3ASearch", label = 0x0, is_nocache = 0}

The only difference is the '&ns0=1' in the query.

Remove the whole logic to detect redirection loops and only rely on exceeding the maximum number of allowed redirections in such a case.

rkta avatar Dec 08 '23 11:12 rkta

Fixes #281

rkta avatar Dec 08 '23 11:12 rkta

When can we merge this PR? I think searching in Wikipedia is a very important use case for W3M. Thank you!

rockydd avatar Feb 17 '24 17:02 rockydd