[Webkit-unassigned] [Bug 204127] New: Inconsistent/lazy encoding of URL.searchParams

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 12 14:47:53 PST 2019


https://bugs.webkit.org/show_bug.cgi?id=204127

            Bug ID: 204127
           Summary: Inconsistent/lazy encoding of URL.searchParams
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: New Bugs
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: jheising at gmail.com

DESCRIPTION:

When a window.URL object is created with a URL string that contains search params with non-url-safe characters, they will only be properly encoded after a call is made to any method on the searchParams member.

It seems like encoding of search parameters is done lazily, when it should probably be done at object construction time.

EXAMPLE:

> var myURL = new URL("https://test.com?param1=my{{bad}}param");
> console.log(myURL.toString());
> // Output: https://test.com/?param1=my{{bad}}param
> // Note how param1 is not properly encoded
>
> myURL.searchParams.sort(); // Doesn't seem matter what method is called— we choose sort here...
> console.log(myURL.toString());
> // Output: https://test.com/?param1=my%7B%7Bbad%7D%7Dparam
> // Note how param1 is now properly encoded

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20191112/36dfda8f/attachment-0001.htm>


More information about the webkit-unassigned mailing list