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

@@ -108,7 +108,7 @@ def parse_headers(lines):
break
while True:
if line in ("\r\n", "\n", ""):
if line in ("\r\n", "\r", "\n", ""):
break
if line[0].isspace():
@@ -189,14 +189,14 @@ def get_uri(url: str):
def urljoin(base, url):
"""
Join a base url and a URL to form an absolute url.
Join a base url, and a URL to form an absolute url.
"""
return urllib.parse.urljoin(base, url)
def get_charset(headers: Dict[str, str]):
"""
Returns the charset of the content from the headers if found. Otherwise returns `FORMAT`
Returns the charset of the content from the headers if found. Otherwise, returns `FORMAT`
@param headers: the headers to retrieve the charset from
@return: A charset