[Webkit-unassigned] [Bug 162345] New: Setting URL.search to '' results in a stringified URL ending in '?'

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 21 09:48:49 PDT 2016


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

            Bug ID: 162345
           Summary: Setting URL.search to '' results in a stringified URL
                    ending in '?'
    Classification: Unclassified
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: All
                OS: All
            Status: NEW
          Severity: Minor
          Priority: P2
         Component: New Bugs
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: jeffy34 at gmail.com

Summary:
A JavaScript developer can clear out the search portion of a URL object by using the search setter with the value ''. In Safari TP, doing so results in a URL object that includes a trailing '?' character, which does not appear to match the behavior in other browsers that support the URL object. Other browsers stringify that URL object without a trailing '?'.

Steps to Reproduce:
In any JavaScript execution context, e.g. the Safari Developer Tools' console, run the following:

    var url = new URL('https://example.com/?testing');
    url.search = '';
    console.log(url.toString());

Expected Results:
The expected logged value is

'https://example.com/'

Actual Results:
The actual logged value is

'https://example.com/?'

Version:
Release 13 (Safari 10.0, WebKit 11603.1.5)

Notes:
The relevant specification is at https://url.spec.whatwg.org/?a=b#concept-urlsearchparams-update

All other modern browsers (Chrome, Firefox, and Edge) appear to properly stringify that example without a trailing '?'.

Configuration:
This happens all the time.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160921/11112964/attachment.html>


More information about the webkit-unassigned mailing list