diff options
| author | J08nY | 2017-06-01 02:38:38 +0200 |
|---|---|---|
| committer | J08nY | 2017-06-01 02:38:38 +0200 |
| commit | 5b2df8d6cd6a6241e044126b020b8a8ebbc9230b (patch) | |
| tree | a81d8ffe4ee13180c5affde92388c0b0e1b68aca /src/mailman/rest/helpers.py | |
| parent | 28dbc044a0d0c464c6800df6b5e27e2b25025b8d (diff) | |
| download | mailman-precompile-rest-matchers.tar.gz mailman-precompile-rest-matchers.tar.zst mailman-precompile-rest-matchers.zip | |
Precompile the REST path regex matchers.precompile-rest-matchers
Diffstat (limited to 'src/mailman/rest/helpers.py')
| -rw-r--r-- | src/mailman/rest/helpers.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mailman/rest/helpers.py b/src/mailman/rest/helpers.py index b8b602dea..b532b330b 100644 --- a/src/mailman/rest/helpers.py +++ b/src/mailman/rest/helpers.py @@ -17,6 +17,7 @@ """Web service helpers.""" +import re import json import falcon import hashlib @@ -26,6 +27,7 @@ from datetime import datetime, timedelta from email.header import Header from email.message import Message from enum import Enum + from lazr.config import as_boolean from mailman.config import config from pprint import pformat @@ -233,6 +235,8 @@ def child(matcher=None): def decorator(func): if matcher is None: func.__matcher__ = func.__name__ + elif isinstance(matcher, str) and matcher.startswith('^'): + func.__matcher__ = re.compile(matcher) else: func.__matcher__ = matcher return func |
