zendframework / zend-diactoros

PSR-7 HTTP Message implementation
BSD 3-Clause "New" or "Revised" License
1.55k stars 152 forks source link

marshal_uri_from_sapi incorrectly assigns scheme #317

Closed crimsonkissaki closed 6 years ago

crimsonkissaki commented 6 years ago

https://github.com/zendframework/zend-diactoros/blob/167607290e79c396fd947cedeadccce0173c0e47/src/functions/marshal_uri_from_sapi.php#L173-L181

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

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