Don't recreate the regular expression for each request
This commit is contained in:
parent
2cf34a0d67
commit
1f9c568720
@ -57,6 +57,8 @@ VERSION = "0.9"
|
|||||||
# tries to access information they don't have rights to
|
# tries to access information they don't have rights to
|
||||||
NOT_ALLOWED = (client.FORBIDDEN, {}, None)
|
NOT_ALLOWED = (client.FORBIDDEN, {}, None)
|
||||||
|
|
||||||
|
WELL_KNOWN_RE = re.compile(r"/.well-known/(carddav|caldav)/?")
|
||||||
|
|
||||||
|
|
||||||
class HTTPServer(wsgiref.simple_server.WSGIServer, object):
|
class HTTPServer(wsgiref.simple_server.WSGIServer, object):
|
||||||
"""HTTP server."""
|
"""HTTP server."""
|
||||||
@ -277,7 +279,7 @@ class Application(object):
|
|||||||
user = environ.get("REMOTE_USER")
|
user = environ.get("REMOTE_USER")
|
||||||
password = None
|
password = None
|
||||||
|
|
||||||
well_known = re.compile(r"/.well-known/(carddav|caldav)/?").match(path)
|
well_known = WELL_KNOWN_RE.match(path)
|
||||||
if well_known:
|
if well_known:
|
||||||
redirect = config.get("well-known", well_known.group(1))
|
redirect = config.get("well-known", well_known.group(1))
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user