mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 10:25:47 +02:00
fix(Listener): skip auth when requirepass is empty on http (#1985)
* Fix a small bug on http when username was required even if requirepass was empty
This commit is contained in:
parent
e15900fd94
commit
8b7a43d214
2 changed files with 18 additions and 1 deletions
|
@ -2075,7 +2075,9 @@ GlobalState Service::GetGlobalState() const {
|
|||
|
||||
void Service::ConfigureHttpHandlers(util::HttpListenerBase* base, bool is_privileged) {
|
||||
// We skip authentication on privileged listener if the flag admin_nopass is set
|
||||
const bool should_skip_auth = is_privileged && !RequirePrivilegedAuth();
|
||||
// We also skip authentication if requirepass is empty
|
||||
const bool should_skip_auth =
|
||||
(is_privileged && !RequirePrivilegedAuth()) || GetPassword().empty();
|
||||
if (!should_skip_auth) {
|
||||
base->SetAuthFunctor([pass = GetPassword()](std::string_view path, std::string_view username,
|
||||
std::string_view password) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue