diff options
author | Sascha Silbe <sascha-pgp@silbe.org> | 2012-04-03 18:49:00 (GMT) |
---|---|---|
committer | Sascha Silbe <sascha-pgp@silbe.org> | 2012-04-03 18:49:00 (GMT) |
commit | 128791e7b7a91d85062d249ed764e78ec9be8eb7 (patch) | |
tree | 195de932e4bb60187cb42e4305c8cb8eadb4183b | |
parent | 44a6fdb8a695395e5e198126984298c0193b51e8 (diff) |
Don't advertise standard WebDAV properties we don't support
Override the PROPS dictionary from dav_interface to remove the properties
that we don't support because they're not applicable or impossible to
determine. This fixes 404 Not Found errors being returned for a proper
request from a client.
-rwxr-xr-x | journal2webdav | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/journal2webdav b/journal2webdav index e54d9f7..f091794 100755 --- a/journal2webdav +++ b/journal2webdav @@ -197,6 +197,12 @@ class ObjectListHtmlResource(object): class JournalHandler(dav_interface): + PROPS={"DAV:" : ('creationdate', + 'getcontentlength', + 'getcontenttype', + 'getlastmodified', + 'resourcetype')} + def __init__(self, file_system, base_uri, verbose=False): self._fs = file_system # required by dav_interface @@ -214,8 +220,7 @@ class JournalHandler(dav_interface): def get_propnames(self, uri): log.debug('get_propnames %r', uri) - # FIXME: we're apparently advertising but not supporting displayname, getcontentlanguage, getetag and source - props_by_ns = {'DAV:': self.PROPS['DAV:']} + props_by_ns = dict(self.PROPS) fs_object = self._lookup_uri(uri) if isinstance(fs_object, fsemulation.DSObject): props_by_ns[SUGAR_NS] = fs_object.list_properties() |