Small cosmetic improvements
This commit is contained in:
parent
86631e4ddd
commit
f87c16a42b
@ -247,9 +247,8 @@ class Application:
|
|||||||
# Mask passwords
|
# Mask passwords
|
||||||
mask_passwords = self.configuration.getboolean(
|
mask_passwords = self.configuration.getboolean(
|
||||||
"logging", "mask_passwords")
|
"logging", "mask_passwords")
|
||||||
authorization = request_environ.get(
|
authorization = request_environ.get("HTTP_AUTHORIZATION", "")
|
||||||
"HTTP_AUTHORIZATION", "").startswith("Basic")
|
if mask_passwords and authorization.startswith("Basic"):
|
||||||
if mask_passwords and authorization:
|
|
||||||
request_environ["HTTP_AUTHORIZATION"] = "Basic **masked**"
|
request_environ["HTTP_AUTHORIZATION"] = "Basic **masked**"
|
||||||
|
|
||||||
return request_environ
|
return request_environ
|
||||||
|
@ -810,9 +810,7 @@ class Collection(BaseCollection):
|
|||||||
def discover(cls, path, depth="0"):
|
def discover(cls, path, depth="0"):
|
||||||
# Path should already be sanitized
|
# Path should already be sanitized
|
||||||
sane_path = sanitize_path(path).strip("/")
|
sane_path = sanitize_path(path).strip("/")
|
||||||
attributes = sane_path.split("/")
|
attributes = sane_path.split("/") if sane_path else []
|
||||||
if not attributes[0]:
|
|
||||||
attributes.pop()
|
|
||||||
|
|
||||||
folder = cls._get_collection_root_folder()
|
folder = cls._get_collection_root_folder()
|
||||||
# Create the root collection
|
# Create the root collection
|
||||||
|
Loading…
x
Reference in New Issue
Block a user