Skip to content
Snippets Groups Projects
Commit 2314059e authored by Andreas Gohr's avatar Andreas Gohr
Browse files

allow for easier HTTPClient debugging

Sometimes users report bugs or problems releated to HTTP connections
made by our HTTPCient (eg. in the extension manager or XMLRPC).
Debugging those problems previously required modifying some sources to
enable the debugging output of the HTTPClient.
This patch adds a way to enable the debugging via a request parameter.
Since HTTP requests are often done only *after* some button was clicked,
the parameter is also looked for in the referrer of a request.
Debugging output is enabled through the existence of the parameter
'httpdebug' and is directly printed to the screen. Debugging HTTP only
works when allowdebug is enabled.
parent dc6ff004
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment