]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/HTTPSignature.php
Removed completely un-used 'http_auth' option from HTTPRequest
[friendica.git] / src / Util / HTTPSignature.php
index 5165f600fc1c340b9de16adc28a683ef8fbc6c00..4d6ae7e90c53b1ff6392114e7e017e725cdfcba4 100644 (file)
@@ -403,7 +403,6 @@ class HTTPSignature
         * @param array   $opts    (optional parameters) assoziative array with:
         *                         'accept_content' => supply Accept: header with 'accept_content' as the value
         *                         'timeout' => int Timeout in seconds, default system config value or 60 seconds
-        *                         'http_auth' => username:password
         *                         'novalidate' => do not validate SSL certs, default is to validate using our CA list
         *                         'nobody' => only return the header
         *                         'cookiejar' => path to cookie jar file
@@ -449,7 +448,11 @@ class HTTPSignature
                $curl_opts = $opts;
                $curl_opts['header'] = $headers;
 
-               $curlResult = DI::httpRequest()->get($request, false, $curl_opts);
+               if ($opts['nobody']) {
+                       $curlResult = DI::httpRequest()->head($request, $curl_opts);
+               } else {
+                       $curlResult = DI::httpRequest()->get($request, $curl_opts);
+               }
                $return_code = $curlResult->getReturnCode();
 
                Logger::log('Fetched for user ' . $uid . ' from ' . $request . ' returned ' . $return_code, Logger::DEBUG);
@@ -484,7 +487,7 @@ class HTTPSignature
                }
 
                $headers = [];
-               $headers['(request-target)'] = strtolower($http_headers['REQUEST_METHOD']) . ' ' . $http_headers['REQUEST_URI'];
+               $headers['(request-target)'] = strtolower($http_headers['REQUEST_METHOD']) . ' ' . parse_url($http_headers['REQUEST_URI'], PHP_URL_PATH);
 
                // First take every header
                foreach ($http_headers as $k => $v) {