1
0
mirror of https://github.com/guzzle/guzzle.git synced 2025-02-25 18:43:22 +01:00

Allowing only HTTP and HTTPS protocols

This commit is contained in:
Michael Dowling 2013-02-09 22:58:25 -08:00
parent c57b28e111
commit d5eec8ee4a

View File

@ -63,6 +63,8 @@ class CurlHandle
CURLOPT_USERAGENT => (string) $request->getHeader('User-Agent'),
CURLOPT_PORT => $request->getPort(),
CURLOPT_HTTPHEADER => array(),
// Allow only HTTP and HTTPS protocols
CURLOPT_PROTOCOLS => CURLPROTO_HTTP | CURLPROTO_HTTPS,
CURLOPT_HEADERFUNCTION => array($mediator, 'receiveResponseHeader'),
CURLOPT_HTTP_VERSION => $request->getProtocolVersion() === '1.0'
? CURL_HTTP_VERSION_1_0 : CURL_HTTP_VERSION_1_1,