Improve logging, fix small issues
This commit is contained in:
@@ -66,12 +66,10 @@ class HTTPServerException(HTTPException):
|
||||
"""
|
||||
status_code: str
|
||||
message: str
|
||||
body: str
|
||||
arg: str
|
||||
|
||||
def __init__(self, arg, body=""):
|
||||
def __init__(self, arg):
|
||||
self.arg = arg
|
||||
self.body = body
|
||||
|
||||
|
||||
class HTTPServerCloseException(HTTPServerException):
|
||||
@@ -160,5 +158,6 @@ class InvalidRequestLine(BadRequest):
|
||||
Request start-line is invalid
|
||||
"""
|
||||
|
||||
def __init__(self, line):
|
||||
def __init__(self, line, arg):
|
||||
super().__init__(arg)
|
||||
self.request_line = line
|
||||
|
@@ -72,7 +72,7 @@ def parse_request_line(line: str):
|
||||
|
||||
split = list(filter(None, line.rstrip().split(" ", 2)))
|
||||
if len(split) < 3:
|
||||
raise InvalidRequestLine(line)
|
||||
raise InvalidRequestLine(line, "missing argument in request-line")
|
||||
|
||||
method, target, version = split
|
||||
if method not in ("CONNECT", "DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT", "TRACE"):
|
||||
|
Reference in New Issue
Block a user