WordPress / WordPress/Requests
Redirect error when server returns invalid Location HTTP header
Open
Nobody has claimed this yet.
Component: Core
- Dominant language
- PHP
- Stars
- 3.6k
- Forks
- 500
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 5
Description
The header is as follows:
HTTP/1.1 301 Moved Permanently
Server: nginx/1.10.1
Date: Mon, 15 Aug 2016 09:14:49 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 0
Connection: keep-alive
X-Powered-By: PHP/5.6.20
Location: index.html
so the $location here is 'index.html' and then throws Requests_Exception with message 'Only HTTP requests are handled.'
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at library/Requests.php around line 706, where the Location header is processed, and reproduce the response with the shown 301 header. Trace the redirect handling and add coverage for this relative Location value; done means the redirect no longer raises the “Only HTTP requests are handled” exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api, networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100