Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow relative redirects #103

Merged
merged 3 commits into from
Feb 11, 2014
Merged

Follow relative redirects #103

merged 3 commits into from
Feb 11, 2014

Conversation

ozh
Copy link
Collaborator

@ozh ozh commented Feb 10, 2014

Should fix #102

@rmccue
Copy link
Collaborator

rmccue commented Feb 11, 2014

Fails with Location: http.html :)

We should check for http:// or https:// explicitly here instead.

@ozh
Copy link
Collaborator Author

ozh commented Feb 11, 2014

Indeed :)

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling 288d630 on ozh:relative_redirects into 5052e11 on rmccue:master.

@rmccue
Copy link
Collaborator

rmccue commented Feb 11, 2014

Thanks! :)

@@ -595,7 +595,7 @@ protected static function parse_response($headers, $url, $req_headers, $req_data
}
$options['redirected']++;
$location = $return->headers['location'];
if (strpos ($location, '/') === 0) {
if (strpos ($location, 'http://') !== 0 || strpos ($location, 'https://') !== 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, is this the correct logic expression? || should be &&, I think...

@ozh
Copy link
Collaborator Author

ozh commented Feb 11, 2014

Of course... Sorry, still early morning breakfast hours, here :)

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.04%) when pulling 35f235b on ozh:relative_redirects into 5052e11 on rmccue:master.

rmccue added a commit that referenced this pull request Feb 11, 2014
Follow relative redirects correctly
@rmccue rmccue merged commit 5c54aaa into WordPress:master Feb 11, 2014
@ozh ozh deleted the relative_redirects branch April 16, 2015 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow relative HTTP redirects
3 participants