This is an automated email from the ASF dual-hosted git repository.
humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git
The following commit(s) were added to refs/heads/master by this push:
new 77c55f1 Switch to fnmatch to allow more global matches
77c55f1 is described below
commit 77c55f143f1c96e201bf68a6505980f2e35c4b7b
Author: Daniel Gruno <[email protected]>
AuthorDate: Sat Sep 11 11:45:09 2021 -0500
Switch to fnmatch to allow more global matches
---
server/endpoints/preferences.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/server/endpoints/preferences.py b/server/endpoints/preferences.py
index 4131dbe..ad0f635 100644
--- a/server/endpoints/preferences.py
+++ b/server/endpoints/preferences.py
@@ -20,6 +20,7 @@ import plugins.aaa
import plugins.session
import aiohttp.web
import typing
+import fnmatch
""" Generic preferences endpoint for Pony Mail codename Foal"""
""" This is incomplete, but will work for anonymous tests. """
@@ -37,8 +38,8 @@ async def process(
if entry.get("private", False):
can_access = plugins.aaa.can_access_list(session, ml)
if server.config.ui.focus_domain != "*":
- if server.config.ui.focus_domain.startswith("*."):
- if not ldomain.endswith(server.config.ui.focus_domain[1:]):
+ if '*' in server.config.ui.focus_domain:
+ if not fnmatch.fnmatch(ldomain,
server.config.ui.focus_domain)
continue
elif ldomain != (server.config.ui.focus_domain or
session.host):
continue