Skip to content

[Bug]: playwright.request merging url with a base url behind a path #2914

Closed
@sebastian-bearing

Description

@sebastian-bearing

Version

latest

Steps to reproduce

when using playwright.request.new_context(base) the response is different due a base error on cpython

from urllib.parse import urljoin

print(urljoin('https://localhost/1/','2'))
# => https://localhost/1/2
print(urljoin('https://localhost/1/','/2'))
# => https://localhost/2
print(urljoin('https://localhost/1','/2'))
# =>https://localhost/2
print(urljoin('https://localhost/1','2'))
# => https://localhost/2

Expected behavior

always call

https://localhost/1/2 regardless the playwright.request.new_context

Actual behavior

depends the base url

Additional context

No response

Environment

- Operating System: [mac os]
- CPU: [arm64]
- Browser: [All, Chromium, Firefox, WebKit]
- Python Version: [3.12]
- Other info: is a core issue on cpython just inform affect this project

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions