Improve documentation

This commit is contained in:
2021-03-28 18:54:52 +02:00
parent c748387b48
commit b7315c2348
11 changed files with 79 additions and 38 deletions

View File

@@ -148,7 +148,7 @@ class AbstractCommand(ABC):
@return: True if the header is invalid, and thus shouldn't be taken into account, throws NotModified
if the content isn't modified since the given date.
@raise NotModified: If the date of if-modified-since greater than the modify date of the resource.
@raise NotModified: If the date of if-modified-since greater than the modify-date of the resource.
"""
date_val = self.msg.headers.get("if-modified-since")
if not date_val:
@@ -164,7 +164,8 @@ class AbstractCommand(ABC):
return True
def get_mimetype(self, path):
@staticmethod
def get_mimetype(path):
"""
Guess the type of file.
@param path: the path to the file to guess the type of
@@ -243,8 +244,8 @@ class HeadCommand(AbstractCommand):
def execute(self):
path = self._get_path()
mime = self.get_mimetype(path)
return self._build_message(200, mime, b"")
@@ -301,6 +302,6 @@ class PutCommand(AbstractModifyCommand):
def execute(self):
if "content-range" in self.msg.headers:
raise BadRequest("PUT request contains Content-Range header")
raise BadRequest("PUT request contains a Content-Range header")
super().execute()