-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(logger): Prevent infinite recursion with log.condition => matches
When we need to check the log condition for a user matches, there is a risk that something on the way checks the log level and would result in an infinite loop. So we simply check if it's a nested call and use the default warning level in that case. Signed-off-by: Joas Schilling <[email protected]>
- Loading branch information
1 parent
2d77570
commit b9493cc
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
# SPDX-License-Identifier: AGPL-3.0-or-later | ||
Feature: log-condition | ||
|
||
Background: | ||
Given invoking occ with "config:system:set log.condition matches 0 users 0 --value admin" | ||
Then the command was successful | ||
|
||
Scenario: Accessing /status.php with log.condition | ||
When requesting "/status.php" with "GET" | ||
Then the HTTP status code should be "200" | ||
|
||
Scenario: Accessing /index.php with log.condition | ||
When requesting "/index.php" with "GET" | ||
Then the HTTP status code should be "200" | ||
|
||
Scenario: Accessing /remote.php/webdav with log.condition | ||
When requesting "/remote.php/webdav" with "GET" | ||
Then the HTTP status code should be "401" | ||
|
||
Scenario: Accessing /remote.php/dav with log.condition | ||
When requesting "/remote.php/dav" with "GET" | ||
Then the HTTP status code should be "401" | ||
|
||
Scenario: Accessing /ocs/v1.php with log.condition | ||
When requesting "/ocs/v1.php" with "GET" | ||
Then the HTTP status code should be "200" | ||
|
||
Scenario: Accessing /ocs/v2.php with log.condition | ||
When requesting "/ocs/v2.php" with "GET" | ||
Then the HTTP status code should be "404" | ||
|
||
Scenario: Accessing /public.php/webdav with log.condition | ||
When requesting "/public.php/webdav" with "GET" | ||
Then the HTTP status code should be "401" | ||
|
||
Scenario: Accessing /public.php/dav with log.condition | ||
When requesting "/public.php/dav" with "GET" | ||
Then the HTTP status code should be "503" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters