Skip to content
Open
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
11 changes: 9 additions & 2 deletions ba-simple-proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,16 @@
curl_setopt( $ch, CURLOPT_HEADER, true );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );

curl_setopt( $ch, CURLOPT_USERAGENT, $_GET['user_agent'] ? $_GET['user_agent'] : $_SERVER['HTTP_USER_AGENT'] );
// in case you wish Not to confirm the CA for your server (e.g. it's inside your org)
// curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER , false);

list( $header, $contents ) = preg_split( '/([\r\n][\r\n])\\1/', curl_exec( $ch ), 2 );
curl_setopt( $ch, CURLOPT_USERAGENT, $_GET['user_agent'] ? $_GET['user_agent'] : $_SERVER['HTTP_USER_AGENT'] );
$res = curl_exec( $ch );
if ($res === FALSE) {
// in case we have errors - let's report them!
die(curl_error($ch));
}
list( $header, $contents ) = preg_split( '/([\r\n][\r\n])\\1/', $res, 2 );

$status = curl_getinfo( $ch );

Expand Down