]> git.mxchange.org Git - friendica.git/blobdiff - src/Security/BasicAuth.php
Merge remote-tracking branch 'upstream/develop' into user-defined-channels
[friendica.git] / src / Security / BasicAuth.php
index 25da9b831818c3972ed206d3f305208df5e21db2..51da7a98ad472429d7f21b0d106b2129b8eb16f9 100644 (file)
@@ -177,7 +177,7 @@ class BasicAuth
                        }
                        Logger::debug('Access denied', ['parameters' => $_SERVER]);
                        // Checking for commandline for the tests, we have to avoid to send a header
-                       if (php_sapi_name() !== 'cli') {
+                       if (DI::config()->get('system', 'basicauth') && (php_sapi_name() !== 'cli')) {
                                header('WWW-Authenticate: Basic realm="Friendica"');
                        }
                        throw new UnauthorizedException("This API requires login");