Skip to content

Commit be66ec2

Browse files
author
Henning Ritter
committed
added static property CURLOPT_RETURNTRANSFER
1 parent 9635c5d commit be66ec2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Proxy.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ class Proxy
5959
*/
6060
public static $DEBUG = false;
6161

62+
/**
63+
* When set to false the fetched result is echoed immediately instead of waiting for the fetch to complete first
64+
* @var bool
65+
*/
66+
public static $CURLOPT_RETURNTRANSFER = true;
67+
6268
/**
6369
* Target URL is set via Proxy-Target-URL header. For debugging purposes you might set it directly here.
6470
* This value overrides any value specified in Proxy-Target-URL header.
@@ -320,7 +326,7 @@ protected static function createRequest($targetURL)
320326
curl_setopt_array($request, [
321327
CURLOPT_FOLLOWLOCATION => true,
322328
CURLOPT_HEADER => true,
323-
CURLOPT_RETURNTRANSFER => true,
329+
CURLOPT_RETURNTRANSFER => static::$CURLOPT_RETURNTRANSFER,
324330
CURLINFO_HEADER_OUT => true,
325331
CURLOPT_HTTPHEADER => $headers
326332
]);

0 commit comments

Comments
 (0)