Pull request 2457: 7987-fix-ratelimiter
Some checks failed
build / test (macOS-latest) (push) Has been cancelled
build / test (ubuntu-latest) (push) Has been cancelled
build / test (windows-latest) (push) Has been cancelled
lint / go-lint (push) Has been cancelled
lint / eslint (push) Has been cancelled
build / build-release (push) Has been cancelled
build / notify (push) Has been cancelled
lint / notify (push) Has been cancelled

Updates #7987.

Squashed commit of the following:

commit ea0c8137bec2cbe0f8c8de8818f325c3d1c4fce7
Merge: 00e992b17 146b6dd09
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Thu Aug 28 19:21:19 2025 +0300

    Merge branch 'master' into 7987-fix-ratelimiter

commit 00e992b175
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Tue Aug 26 15:31:31 2025 +0300

    home: imp code

commit 2fdb14b579
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Mon Aug 25 20:24:57 2025 +0300

    all: fix ratelimiter
This commit is contained in:
Stanislav Chzhen
2025-08-28 19:32:53 +03:00
parent 146b6dd094
commit 2e5005d7df
2 changed files with 4 additions and 1 deletions

View File

@@ -20,10 +20,12 @@ NOTE: Add new changes BELOW THIS COMMENT.
### Fixed
- Authentication errors in the Web UI when AdGuard Home is behind a proxy that sets Basic Auth headers ([#7987]).
- The HTTP API `GET /control/profile` endpoint failing when no users were configured ([#7985]).
- Missing warning on the *Encryption Settings* page when using a certificate without an IP address.
[#7985]: https://github.com/AdguardTeam/AdGuardHome/issues/7985
[#7987]: https://github.com/AdguardTeam/AdGuardHome/issues/7987
<!--
NOTE: Add new changes ABOVE THIS COMMENT.

View File

@@ -506,9 +506,10 @@ func (mw *authMiddlewareDefault) userFromRequestBasicAuth(
return nil, fmt.Errorf("login attempt blocked for %s", left)
}
rateLimiter.inc(remoteIP)
defer func() {
if err != nil {
rateLimiter.inc(remoteIP)
return
}