Page MenuHomePhabricator

toolserver redirects double encode params
Closed, ResolvedPublic

Description

It looks like the toolserver.org redirects double encode URL parameters

IE: http://
becomes:
http%3A%2F%2

Event Timeline

Betacommand raised the priority of this task from to Needs Triage.
Betacommand updated the task description. (Show Details)
Betacommand added a subscriber: Betacommand.

IE: http://
becomes:
http%3A%2F%2

Those are equivalent (: = %2A, / = %2F). So:

?q=http://en.wikipedia.org

is equivalent to

?q=http%3A%2F%2Fen.wikipedia.org

but

?q=http%253A%252F%252Fen.wikipedia.org

would be double-encoded. Do you have an example URL where this is an issue?

This seems to be related to the http->https redirect on toolserver.org rather than the toolserver.org -> tools.wmflabs.org redirect:

valhallasw@maeglin:~$ curl -I -L "http://www.toolserver.org/~betacommand/cgi-bin/cite.py?url=http%3A%2F%2Fen.wikipedia.org"                                                                                                                0
HTTP/1.1 302 Found
Date: Wed, 09 Sep 2015 12:13:41 GMT
Server: Apache
Location: https://www.toolserver.org/~betacommand/cgi-bin/cite.py?url=http%253A%252F%252Fen.wikipedia.org
Content-Type: text/html; charset=iso-8859-1

HTTP/1.1 301 Moved Permanently
Date: Wed, 09 Sep 2015 12:13:42 GMT
Server: Apache
Location: https://tools.wmflabs.org/betacommand-dev/cgi-bin/cite.py?url=http%253A%252F%252Fen.wikipedia.org
Content-Type: text/html; charset=iso-8859-1
valhallasw@maeglin:~$ curl -I -L "https://www.toolserver.org/~betacommand/cgi-bin/cite.py?url=http%3A%2F%2Fen.wikipedia.org"                                                                                                               0
HTTP/1.1 301 Moved Permanently
Date: Wed, 09 Sep 2015 12:13:49 GMT
Server: Apache
Location: https://tools.wmflabs.org/betacommand-dev/cgi-bin/cite.py?url=http%3A%2F%2Fen.wikipedia.org
Content-Type: text/html; charset=iso-8859-1

Change 237089 had a related patch set uploaded (by Merlijn van Deen):
toolserver: do not escape when redirecting from http to https

https://gerrit.wikimedia.org/r/237089

Change 237089 merged by coren:
toolserver: do not escape when redirecting from http to https

https://gerrit.wikimedia.org/r/237089

valhallasw claimed this task.
valhallasw@maeglin:sites$ curl -I -L "http://toolserver.org/~betacommand/cgi-bin/cite.py?url=http%3A%2F%2Fen.wikipedia.org"                                                                                                     production 1
HTTP/1.1 302 Found
Date: Wed, 09 Sep 2015 13:17:31 GMT
Server: Apache
Location: https://www.toolserver.org/~betacommand/cgi-bin/cite.py?url=http%3A%2F%2Fen.wikipedia.org
Content-Type: text/html; charset=iso-8859-1