Page MenuHomePhabricator

Redirecting ~ -> %7E causes a redirect loop in chrome
Closed, ResolvedPublic

Description

$ curl -I https://commons.wikimedia.org/wiki/User_talk:Budsus~idwiki
HTTP/1.1 301 Moved Permanently
Server: nginx/1.9.2
Date: Thu, 09 Jul 2015 05:47:32 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
X-Powered-By: HHVM/3.6.1
X-Content-Type-Options: nosniff
Vary: Accept-Encoding,X-Forwarded-Proto,Cookie
Location: https://commons.wikimedia.org/wiki/User_talk:Budsus%7Eidwiki
Last-Modified: Thu, 09 Jul 2015 05:44:12 GMT
X-Varnish: 2725651390 2725218413, 3948743695, 3671898870
Via: 1.1 varnish, 1.1 varnish, 1.1 varnish
Age: 200
X-Cache: cp1065 hit (2), cp4016 miss (0), cp4017 frontend miss (0)
Strict-Transport-Security: max-age=31536000
Cache-Control: private, s-maxage=0, max-age=0, must-revalidate
Set-Cookie: GeoIP=CN:23:Shanghai:31.0456:121.3997:v4; Path=/; Domain=.wikimedia.org
X-Analytics: https=1
Set-Cookie: WMF-Last-Access=09-Jul-2015;Path=/;HttpOnly;Expires=Mon, 10 Aug 2015 00:00:00 GMT

Expected: Instead of “HTTP/1.1 301 Moved Permanently” with "Location: https://commons.wikimedia.org/wiki/User_talk:Budsus%7Eidwiki", it should be "HTTP/1.1 200 OK" without the Location header.

Event Timeline

zhuyifei1999 raised the priority of this task from to Needs Triage.
zhuyifei1999 updated the task description. (Show Details)
zhuyifei1999 added a project: Commons.
zhuyifei1999 added subscribers: zhuyifei1999, Yann, Bawolff.
Restricted Application added subscribers: Steinsplitter, Aklapper. · View Herald TranscriptJul 9 2015, 5:50 AM

Expected: Instead of “HTTP/1.1 301 Moved Permanently” with "Location: https://commons.wikimedia.org/wiki/User_talk:Budsus%7Eidwiki", it should be "HTTP/1.1 200 OK" without the Location header.

Specifically it appears that chrome normalizes the url back to https://commons.wikimedia.org/wiki/User_talk:Budsus~idwiki, causes an indef loop

Bawolff set Security to None.
Restricted Application added a subscriber: Matanya. · View Herald TranscriptJul 9 2015, 5:52 AM
zhuyifei1999 moved this task from Incoming to Backlog on the Commons board.Jul 9 2015, 5:56 AM
Bawolff added a subscriber: Krinkle.Jul 9 2015, 6:03 AM

This is a regression from 155d555b83eca640 (ping @Krinkle )

Bawolff renamed this task from https://commons.wikimedia.org/wiki/User_talk:Budsus~idwiki is a 301 redirect to the page itself to Redirecting ~ -> %7E causes a redirect loop in chrome.Jul 9 2015, 6:03 AM

Change 223727 had a related patch set uploaded (by Brian Wolff):
Do not encode '~' as ~. Fixes redirect loop in chrome.

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

TheDJ added a subscriber: TheDJ.Jul 9 2015, 10:45 AM

Perhaps file a ticket with chrome as well ?

Change 223756 had a related patch set uploaded (by Krinkle):
Do not encode '~' as ~. Fixes redirect loop in chrome.

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

Change 223727 merged by jenkins-bot:
Do not encode '~' as ~. Fixes redirect loop in chrome.

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

Change 223756 merged by jenkins-bot:
Do not encode '~' as ~. Fixes redirect loop in chrome.

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

Krinkle closed this task as Resolved.Jul 9 2015, 11:21 AM