small fixes
This commit is contained in:
@@ -7,6 +7,7 @@ from time import mktime
|
||||
from wsgiref.handlers import format_date_time
|
||||
|
||||
from client.httpclient import FORMAT
|
||||
from httplib import parser
|
||||
from httplib.exceptions import NotFound, Forbidden, NotModified
|
||||
from httplib.message import ServerMessage as Message
|
||||
|
||||
@@ -16,6 +17,7 @@ status_message = {
|
||||
200: "OK",
|
||||
201: "Created",
|
||||
202: "Accepted",
|
||||
204: "No Content",
|
||||
304: "Not Modified",
|
||||
400: "Bad Request",
|
||||
404: "Not Found",
|
||||
@@ -56,7 +58,7 @@ class AbstractCommand(ABC):
|
||||
|
||||
def _get_date(self):
|
||||
"""
|
||||
Returns a string representation of the current date according to RFC 1123
|
||||
Returns a string representation of the current date according to RFC 1123.
|
||||
"""
|
||||
now = datetime.now()
|
||||
stamp = mktime(now.timetuple())
|
||||
@@ -167,7 +169,8 @@ class AbstractModifyCommand(AbstractCommand, ABC):
|
||||
else:
|
||||
status = 201
|
||||
|
||||
return self._build_message(status, None, )
|
||||
location = parser.urljoin("/", os.path.relpath(path, root))
|
||||
return self._build_message(status, "text/plain", b"", {"Location": location})
|
||||
|
||||
|
||||
class HeadCommand(AbstractCommand):
|
||||
|
Reference in New Issue
Block a user