Преглед на файлове

fix: Decode URL-encoded characters in passwords

This enables using passwords containing special characters.
Zhaofeng Li преди 8 месеца
родител
ревизия
e63d5778a8
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      backend/apps/webui/internal/wrappers.py

+ 2 - 2
backend/apps/webui/internal/wrappers.py

@@ -43,7 +43,7 @@ class ReconnectingPostgresqlDatabase(CustomReconnectMixin, PostgresqlDatabase):
 
 
 
 
 def register_connection(db_url):
 def register_connection(db_url):
-    db = connect(db_url)
+    db = connect(db_url, unquote_password=True)
     if isinstance(db, PostgresqlDatabase):
     if isinstance(db, PostgresqlDatabase):
         # Enable autoconnect for SQLite databases, managed by Peewee
         # Enable autoconnect for SQLite databases, managed by Peewee
         db.autoconnect = True
         db.autoconnect = True
@@ -51,7 +51,7 @@ def register_connection(db_url):
         log.info("Connected to PostgreSQL database")
         log.info("Connected to PostgreSQL database")
 
 
         # Get the connection details
         # Get the connection details
-        connection = parse(db_url)
+        connection = parse(db_url, unquote_password=True)
 
 
         # Use our custom database class that supports reconnection
         # Use our custom database class that supports reconnection
         db = ReconnectingPostgresqlDatabase(**connection)
         db = ReconnectingPostgresqlDatabase(**connection)