wsgidav.util.checked_etag

wsgidav.util.checked_etag(etag, *, allow_none=False)[source]

Validate etag string to ensure propare comparison.

This function is used to assert that DAVResource.get_etag() does not add quotes, so it can be passed as ETag: “<etag_value>” header. Note that we also reject weak entity tags (W/”<etag_value>”), since WebDAV servers commonly use strong ETags.