authorization: add warning if a domian in "cors_domains" contains a trailing slash
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
f94a27c8e4
commit
7f740ccb5a
|
@ -119,8 +119,14 @@ class Authorization:
|
||||||
raise config.error(
|
raise config.error(
|
||||||
f"Unsafe CORS Domain '{domain}'. Wildcards are not"
|
f"Unsafe CORS Domain '{domain}'. Wildcards are not"
|
||||||
" permitted in the top level domain.")
|
" permitted in the top level domain.")
|
||||||
self.cors_domains.append(
|
if domain.endswith("/"):
|
||||||
domain.replace(".", "\\.").replace("*", ".*"))
|
self.server.add_warning(
|
||||||
|
f"Invalid domain '{domain}' in option 'cors_domains', "
|
||||||
|
"section [authorization]. Domain's cannot contain a "
|
||||||
|
"trailing slash.")
|
||||||
|
else:
|
||||||
|
self.cors_domains.append(
|
||||||
|
domain.replace(".", "\\.").replace("*", ".*"))
|
||||||
|
|
||||||
# Get Trusted Clients
|
# Get Trusted Clients
|
||||||
self.trusted_ips: List[IPAddr] = []
|
self.trusted_ips: List[IPAddr] = []
|
||||||
|
|
Loading…
Reference in New Issue