Add HTTPRequest::head() function

This commit is contained in:
Philipp
2020-10-18 22:15:20 +02:00
parent bfbf8816e2
commit 61da51c2d5
4 changed files with 34 additions and 8 deletions
+5 -1
View File
@@ -449,7 +449,11 @@ class HTTPSignature
$curl_opts = $opts;
$curl_opts['header'] = $headers;
$curlResult = DI::httpRequest()->get($request, $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);