Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reject non-HTTP schemes in StreamHandler (#2989)
* Handle non-HTTP schemes gracefully in StreamHandler If an URI that does not use the HTTP stream wrapper is passed to the StreamHandler then the magic `$http_response_header` variable will not be filled, thus remaining `null`. This ultimately results in a `TypeError`, because `null` is passed to HeaderProcessor::parseHeaders(), which expects an `array`. * Reject non-HTTP schemes in StreamHandler Non-HTTP schemes are effectively not supported, because the HTTP response headers will only be filled for the `http` and `https` stream wrappers. Also Guzzle is an HTTP client after all. Reject non-HTTP schemes early on to improve error messages and to prevent possible exploits using odd stream wrappers in case an non-fully-trusted URL is passed to Guzzle.
- Loading branch information