Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

marshal_uri_from_sapi incorrectly assigns scheme #317

Closed
crimsonkissaki opened this issue Jul 19, 2018 · 0 comments
Closed

marshal_uri_from_sapi incorrectly assigns scheme #317

crimsonkissaki opened this issue Jul 19, 2018 · 0 comments

Comments

@crimsonkissaki
Copy link

// URI scheme
$scheme = 'http';
$https = array_key_exists('HTTPS', $server) ? $server['HTTPS'] : false;
if (($https && 'off' !== $https)
|| $getHeaderFromArray('x-forwarded-proto', $headers, false) === 'https'
) {
$scheme = 'https';
}
$uri = $uri->withScheme($scheme);

This incorrectly assigns 'https' instead of 'http' due to case-sensitive comparison, causing anything using UriInterface to generate incorrect URLs.

My $_SERVER['HTTPS'] == 'OFF'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant