Skip to content

Commit 5cb8f33

Browse files
authored
Fix trailing question mark being added for GET requests without parameters.
1 parent 929165c commit 5cb8f33

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/pygbag/support/cross/aio/fetch.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,10 @@ async def get(self, url, params=None, doseq=False):
303303
if self.is_emscripten:
304304
query_string = urlencode(params, doseq=doseq)
305305
await asyncio.sleep(0)
306-
content = await platform.jsiter(platform.window.Fetch.GET(url + "?" + query_string))
306+
if query_string == "":
307+
content = await platform.jsiter(platform.window.Fetch.GET(url))
308+
else:
309+
content = await platform.jsiter(platform.window.Fetch.GET(url + "?" + query_string))
307310
if self.debug:
308311
self.print(content)
309312
self.result = content

0 commit comments

Comments
 (0)