summaryrefslogtreecommitdiff
path: root/inc/HTTPClient.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/HTTPClient.php')
-rw-r--r--inc/HTTPClient.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/inc/HTTPClient.php b/inc/HTTPClient.php
index 4352bcb97..cd4c7c4c5 100644
--- a/inc/HTTPClient.php
+++ b/inc/HTTPClient.php
@@ -35,6 +35,19 @@ class DokuHTTPClient extends HTTPClient {
$this->proxy_pass = conf_decodeString($conf['proxy']['pass']);
$this->proxy_ssl = $conf['proxy']['ssl'];
$this->proxy_except = $conf['proxy']['except'];
+
+ // allow enabling debugging via URL parameter (if debugging allowed)
+ if($conf['allowdebug']) {
+ if(
+ isset($_REQUEST['httpdebug']) ||
+ (
+ isset($_SERVER['HTTP_REFERER']) &&
+ strpos($_SERVER['HTTP_REFERER'], 'httpdebug') !== false
+ )
+ ) {
+ $this->debug = true;
+ }
+ }
}
@@ -795,7 +808,7 @@ class HTTPClient {
function _buildHeaders($headers){
$string = '';
foreach($headers as $key => $value){
- if(empty($value)) continue;
+ if($value === '') continue;
$string .= $key.': '.$value.HTTP_NL;
}
return $string;