]> git.mxchange.org Git - friendica.git/commitdiff
Possibly fixing the test
authorMichael <heluecht@pirati.ca>
Thu, 18 Nov 2021 08:03:50 +0000 (08:03 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 18 Nov 2021 08:03:50 +0000 (08:03 +0000)
src/Security/BasicAuth.php

index 52657057e9078bedd34af0a2e5d75a700b18fa8d..eaed9d22e5ae4a9659f37e0df1afae071f00a90b 100644 (file)
@@ -177,7 +177,10 @@ class BasicAuth
                                return 0;
                        }
                        Logger::debug('Access denied', ['parameters' => $_SERVER]);
-                       header('WWW-Authenticate: Basic realm="Friendica"');
+                       // Checking for commandline for the tests, we have to avoid to send a header
+                       if (php_sapi_name() !== 'cli') {
+                               header('WWW-Authenticate: Basic realm="Friendica"');
+                       }
                        throw new UnauthorizedException("This API requires login");
                }