Skip to content

Commit

Permalink
Explicitly check for leading http(s):// in URL
Browse files Browse the repository at this point in the history
  • Loading branch information
ozh committed Feb 11, 2014
1 parent 01b2ec9 commit 288d630
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/Requests.php
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ protected static function parse_response($headers, $url, $req_headers, $req_data
}
$options['redirected']++;
$location = $return->headers['location'];
if (strpos ($location, 'http') !== 0) {
if (strpos ($location, 'http://') !== 0 || strpos ($location, 'https://') !== 0) {
// relative redirect, for compatibility make it absolute
$location = Requests_IRI::absolutize($url, $location);
$location = $location->uri;
Expand Down

0 comments on commit 288d630

Please sign in to comment.