fix: resolve webhook client IP behind proxies

This commit is contained in:
3252a8
2026-06-08 11:25:02 +03:00
parent 23ad893f69
commit c2f0ae0b8b
21 changed files with 161 additions and 25 deletions
+20
View File
@@ -42,6 +42,26 @@ class SettingsTests(unittest.TestCase):
self.assertEqual(settings.WEBAPP_TITLE, "/minishop")
def test_trusted_proxies_default_includes_private_proxy_ranges(self):
settings = Settings(
_env_file=None,
BOT_TOKEN="token",
POSTGRES_USER="app_user",
POSTGRES_PASSWORD="app_password",
)
self.assertEqual(
settings.trusted_proxies,
[
"127.0.0.1",
"::1",
"10.0.0.0/8",
"172.16.0.0/12",
"192.168.0.0/16",
"fc00::/7",
],
)
def test_panel_write_mode_defaults_to_live_in_production(self):
settings = Settings(
_env_file=None,