Opened 20 months ago
Last modified 20 months ago
#18685 new defect (bug)
GET Requests with hostname in them causes wrong redirect
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | General | Version: | 3.2.1 |
| Severity: | normal | Keywords: | has-patch dev-feedback |
| Cc: |
Description
Hi!
I have noticed that my Android phone when using Cyanogenmod with default browser does some "special" things when on 3G. (It does not happend via WiFi)
It appears that the hostname is sent with every GET-request. Its common to only send the path in a GET-request but the HTTP secification also allows for the use of hostname within a GET-request.
My test page ( http://h3x.no/dump/test.php ) shows the hostname in the REQUEST_URI via 3G, and skips the hostname when on WiFi.
This causes Wordpress(i suspect) to redirect me to the wrong page.
Example:
I want the page:
http://h3x.no/2011/09/12/getting-windows-2008-server-uptime-via-the-command-line
My phone sends me to:
http://h3x.no/2011/09/12/getting-windows-2008-server-uptime-via-the-command-line/http/h3x.no/2011/09/12/getting-windows-2008-server-uptime-via-the-command-line
Attachments (1)
Change History (2)
comment:1
solarissmoke — 20 months ago
- Keywords has-patch dev-feedback added; needs-patch removed

Confirmed that this happens when you use an absolute URI in the GET request. WordPress assumes (incorrectly it seems) that REQUEST_URI will never contain a hostname.
POC patch attached - although this issue has never come up before (probably because most clients are HTTP/1.1 compliant in this regard and send proper requests - the requirement to accept a fully qualified address is only for backward compatibility with HTTP/1.0), so I'm not sure whether the real bug lies with the client.