diff --git a/browser/main.py b/browser/main.py index af9913e..072a2aa 100644 --- a/browser/main.py +++ b/browser/main.py @@ -8,8 +8,7 @@ if len(sys.argv) == 2: browser.load(sys.argv[1]) else: - browser.load("file:///home/vever/cs/browser/browser/tests/index.html") - # browser.load("https://browser.engineering/layout.html") + browser.load("https://browser.engineering/styles.html") # browser.load("https://www.w3.org/Style/CSS/Test/CSS1/current/test5526c.htm") diff --git a/browser/request.py b/browser/request.py index 84c3ff6..da88daa 100644 --- a/browser/request.py +++ b/browser/request.py @@ -98,12 +98,12 @@ def request(url, num_redirects=0): pos = 0 while True: start = body.find(b"\r\n", pos) - length = int(body[pos:start].decode()) + length = int(body[pos:start].decode(), 16) if length == 0: break - end = body.find(b"\r\n", start + 2) + end = start + length + 2 new_body += body[start + 2 : end] pos = end + 2