Skip to content

Commit

Permalink
Simply connect() URL parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
Bluenix2 committed Mar 5, 2022
1 parent 3bbc355 commit 6bbc07e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions discord_gateway/conn.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,7 @@ def connect(self) -> bytes:
if parsed.hostname is None:
raise ValueError(f"Cannot parse hostname out of URI '{self.uri}'")

target = '/'
if parsed.path:
target = parsed.path
target = parsed.path or '/'

target += '?'
if parsed.query:
Expand All @@ -267,7 +265,7 @@ def connect(self) -> bytes:
target += self.query_params

if parsed.fragment:
target += '#' + parsed.fragment
target += f'#{parsed.fragment}'

return self._proto.send(Request(parsed.hostname, target))

Expand Down

0 comments on commit 6bbc07e

Please sign in to comment.