Return UNAUTHORIZED for NOT_FOUND PROPFINDs
This commit is contained in:
parent
76b859c28e
commit
b71664b322
@ -364,7 +364,8 @@ class Application:
|
|||||||
else:
|
else:
|
||||||
status, headers, answer = NOT_ALLOWED
|
status, headers, answer = NOT_ALLOWED
|
||||||
|
|
||||||
if (status, headers, answer) == NOT_ALLOWED and not is_authenticated:
|
if (status, headers, answer) == NOT_ALLOWED and not (
|
||||||
|
user and is_authenticated):
|
||||||
# Unknown or unauthorized user
|
# Unknown or unauthorized user
|
||||||
self.logger.info("%s refused" % (user or "Anonymous user"))
|
self.logger.info("%s refused" % (user or "Anonymous user"))
|
||||||
status = client.UNAUTHORIZED
|
status = client.UNAUTHORIZED
|
||||||
@ -545,7 +546,7 @@ class Application:
|
|||||||
content, user):
|
content, user):
|
||||||
"""Manage PROPFIND request."""
|
"""Manage PROPFIND request."""
|
||||||
if not read_collections:
|
if not read_collections:
|
||||||
return client.NOT_FOUND, {}, None
|
return (client.NOT_FOUND, {}, None) if user else NOT_ALLOWED
|
||||||
headers = {
|
headers = {
|
||||||
"DAV": "1, 2, 3, calendar-access, addressbook, extended-mkcol",
|
"DAV": "1, 2, 3, calendar-access, addressbook, extended-mkcol",
|
||||||
"Content-Type": "text/xml"}
|
"Content-Type": "text/xml"}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user