Skip to content

Commit 67e83a8

Browse files
authored
Merge pull request #5 from Henning256/master
Add static properties to control curlopt options
2 parents 9635c5d + b0bfb40 commit 67e83a8

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

Proxy.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,18 @@ class Proxy
5959
*/
6060
public static $DEBUG = false;
6161

62+
/**
63+
* When set to false the fetched header is not included in the result
64+
* @var bool
65+
*/
66+
public static $CURLOPT_HEADER = true;
67+
68+
/**
69+
* When set to false the fetched result is echoed immediately instead of waiting for the fetch to complete first
70+
* @var bool
71+
*/
72+
public static $CURLOPT_RETURNTRANSFER = true;
73+
6274
/**
6375
* Target URL is set via Proxy-Target-URL header. For debugging purposes you might set it directly here.
6476
* This value overrides any value specified in Proxy-Target-URL header.
@@ -319,8 +331,8 @@ protected static function createRequest($targetURL)
319331

320332
curl_setopt_array($request, [
321333
CURLOPT_FOLLOWLOCATION => true,
322-
CURLOPT_HEADER => true,
323-
CURLOPT_RETURNTRANSFER => true,
334+
CURLOPT_HEADER => static::$CURLOPT_HEADER,
335+
CURLOPT_RETURNTRANSFER => static::$CURLOPT_RETURNTRANSFER,
324336
CURLINFO_HEADER_OUT => true,
325337
CURLOPT_HTTPHEADER => $headers
326338
]);

0 commit comments

Comments
 (0)