RESOLVED FIXED 140174
DOM URL pathname setter double encodes entities
https://bugs.webkit.org/show_bug.cgi?id=140174
Summary DOM URL pathname setter double encodes entities
Joshua Peek
Reported 2015-01-06 21:13:51 PST
Created attachment 244139 [details] URL pathname test The URL pathname setter incorrectly re-encodes the target value before setting it as the pathname attribute. The getter always correctly returns the undecoded pathname. var url = new URL("http://example.com/") url.pathname = "foo%20bar" url.pathname // "/foo%2520bar" url.href // "http://example.com/foo%2520bar" This breaks the ability to reset pathname with the value from its getter. var url = new URL("http://example.com/foo%20bar") url.pathname // "/foo%20bar" url.pathname = url.pathname + "/123" url.pathname // "/foo%2520bar/123" I don't think the pathname setter is correctly performing the "Basic URL parse" step in https://url.spec.whatwg.org/#dom-urlutils-pathname
Attachments
URL pathname test (679 bytes, patch)
2015-01-06 21:13 PST, Joshua Peek
no flags
Rob Buis
Comment 1 2020-06-28 05:23:10 PDT
This is fixed these days.
Note You need to log in before you can comment on or make changes to this bug.