Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions Proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,18 @@ class Proxy
*/
public static $DEBUG = false;

/**
* When set to false the fetched header is not included in the result
* @var bool
*/
public static $CURLOPT_HEADER = true;

/**
* When set to false the fetched result is echoed immediately instead of waiting for the fetch to complete first
* @var bool
*/
public static $CURLOPT_RETURNTRANSFER = true;

/**
* Target URL is set via Proxy-Target-URL header. For debugging purposes you might set it directly here.
* This value overrides any value specified in Proxy-Target-URL header.
Expand Down Expand Up @@ -319,8 +331,8 @@ protected static function createRequest($targetURL)

curl_setopt_array($request, [
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HEADER => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER => static::$CURLOPT_HEADER,
CURLOPT_RETURNTRANSFER => static::$CURLOPT_RETURNTRANSFER,
CURLINFO_HEADER_OUT => true,
CURLOPT_HTTPHEADER => $headers
]);
Expand Down