Skip to content

Commit

Permalink
Case insensitive comparison for the scheme element.
Browse files Browse the repository at this point in the history
  • Loading branch information
dd32 committed Sep 9, 2016
1 parent 63dd9b8 commit 9b402cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/Requests/Transport/fsockopen.php
Expand Up @@ -171,7 +171,7 @@ public function request($url, $headers = array(), $data = array(), $options = ar
if (!isset($case_insensitive_headers['Host'])) {
$out .= sprintf('Host: %s', $url_parts['host']);

if (( 'http' === $url_parts['scheme'] && $url_parts['port'] !== 80 ) || ( 'https' === $url_parts['scheme'] && $url_parts['port'] !== 443 )) {
if (( 'http' === strtolower($url_parts['scheme']) && $url_parts['port'] !== 80 ) || ( 'https' === strtolower($url_parts['scheme']) && $url_parts['port'] !== 443 )) {
$out .= ':' . $url_parts['port'];
}
$out .= "\r\n";
Expand Down

0 comments on commit 9b402cb

Please sign in to comment.