From 5187250ba942d3c5100982d071332f5b4b561119 Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Wed, 9 Nov 2022 18:05:59 +0900 Subject: Support URL query --- src/fead.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fead.py b/src/fead.py index 600dff0..ffe7b6f 100755 --- a/src/fead.py +++ b/src/fead.py @@ -151,7 +151,8 @@ async def fetch(raw_url): reader, writer = await open_connection(url.hostname, 80) else: raise ValueError(f'unsupported URL scheme: {url.scheme}') - writer.write(REQUEST.format(url.path or '/', url.hostname).encode()) + writer.write(REQUEST.format(f"{url.path or '/'}?{url.query}", + url.hostname).encode()) response = HTTPResponse(BytesSocket(await reader.read())) writer.close() -- cgit 1.4.1