]> git.mxchange.org Git - friendica.git/blobdiff - src/Network/HTTPRequest.php
Replaced debug log
[friendica.git] / src / Network / HTTPRequest.php
index 6442295273857e7af78df608b614f9e97e30fa22..a0d940414e0a7c331be5cd63d08c7f0fa5c5ee4c 100644 (file)
@@ -52,6 +52,17 @@ class HTTPRequest implements IHTTPRequest
                $this->baseUrl  = $baseUrl->get();
        }
 
+       /** {@inheritDoc}
+        *
+        * @throws HTTPException\InternalServerErrorException
+        */
+       public function head(string $url, array $opts = [])
+       {
+               $opts['nobody'] = true;
+
+               return $this->get($url, $opts);
+       }
+
        /**
         * {@inheritDoc}
         *
@@ -130,6 +141,7 @@ class HTTPRequest implements IHTTPRequest
                curl_setopt($ch, CURLOPT_ENCODING, '');
 
                if (!empty($opts['headers'])) {
+                       $this->logger->notice('Wrong option \'headers\' used.');
                        @curl_setopt($ch, CURLOPT_HTTPHEADER, $opts['headers']);
                }
 
@@ -172,8 +184,6 @@ class HTTPRequest implements IHTTPRequest
                        curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
                }
 
-               $logger = $this->logger;
-
                $s         = @curl_exec($ch);
                $curl_info = @curl_getinfo($ch);