1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 07:36:14 -05:00

Incorrect Read only connection string on development self-hosted environment (#5426)

This commit is contained in:
Maciej Zieniuk
2025-02-20 20:21:50 +01:00
committed by GitHub
parent 5bbd905401
commit 93e5f7d0fe
7 changed files with 168 additions and 18 deletions

View File

@ -241,7 +241,18 @@ public class GlobalSettings : IGlobalSettings
public string ConnectionString
{
get => _connectionString;
set => _connectionString = value.Trim('"');
set
{
// On development environment, the self-hosted overrides would not override the read-only connection string, since it is already set from the non-self-hosted connection string.
// This causes a bug, where the read-only connection string is pointing to self-hosted database.
if (!string.IsNullOrWhiteSpace(_readOnlyConnectionString) &&
_readOnlyConnectionString == _connectionString)
{
_readOnlyConnectionString = null;
}
_connectionString = value.Trim('"');
}
}
public string ReadOnlyConnectionString