Add url encoding option to URL.resolve#1646
Conversation
Given: a.href = "over 9000!" Then: a.href === BASE_URL + '/over%209000!'; This commits adds an escape: bool option to URL.resolve which will escape the path, query and fragment when true. Also changes the Anchor, Image, Link and IFrame getSrc to escape. Escaping is also used when navigating a frame.
|
@krichprollsch I didn't do it in this PR, but should the main URL we pass to navigate also be escaped? If you: You'll get an error, if you If we decide not to escape the main navigation url, then we need to change https://github.com/lightpanda-io/demo/pull/117/changes#diff-15ff6b6f810cbccf0c86f043b8815c1ca9e84110c983dba1958ac3f993f311b5R286 to escape the URL..because, right now, many WPT tests are failing to navigate because it's an invalid URL. |
|
I will update the runner to escape the URL, seems OK to refuse invalid URL input. |
|
Hum, I tested with Chrome and cdpcli, and calling But it's not that easy, we musn't double escape the url: And this is not a feature from the client: |
Given:
a.href = "over 9000!"
Then:
a.href === BASE_URL + '/over%209000!';
This commits adds an escape: bool option to URL.resolve which will escape the path, query and fragment when true.
Also changes the Anchor, Image, Link and IFrame getSrc to escape. Escaping is also used when navigating a frame.