Skip to content

Commit e84ca7f

Browse files
committed
ws is also normalized
1 parent 3387f89 commit e84ca7f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

playwright/_impl/_helper.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,9 @@ def resolve_base_url(
244244
url = urlparse(urljoin(base_url if base_url is not None else "", given_url))
245245

246246
# In Node.js, new URL('http://localhost') returns 'http://localhost/'.
247-
if url.scheme.startswith("http") and url.path == "":
247+
if (
248+
url.scheme.startswith("http") or url.scheme.startswith("ws")
249+
) and url.path == "":
248250
url = url._replace(path="/")
249251

250252
resolved = urlunparse(url)

0 commit comments

Comments
 (0)