[Webkit-unassigned] [Bug 228122] Add functionalities for parsing URL query string

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 3 14:03:48 PDT 2021


--- Comment #34 from Risul Islam <risul_islam at apple.com> ---
Comment on attachment 434848
  --> https://bugs.webkit.org/attachment.cgi?id=434848

View in context: https://bugs.webkit.org/attachment.cgi?id=434848&action=review

>>>> Source/WTF/wtf/URL.cpp:1173
>>>> +        return { };
>>> Not 100% sure this is the best behavior if only one of the URLs is invalid. Depends on how we intend to use these functions.
>>> Tests should cover this behavior.
>> I think invalid URLs' queries are empty StringViews, so this is just a performance optimization which is probably unnecessary.
> Earlier we returned optional null if any of the url is null. Following recommendation, we changed that to returning empty vector. 
> URL url1 = createURL("www.webkit.org/?");
> URL url2 = createURL("http://www.webkit.org/?key1=val1");
> Vector<KeyValuePair<String, String>> testVector { };
> EXPECT_EQ(differingQueryParameters(url1, url2), testVector);
> This test is covering that behavior. We can add more.

Alex: if both urls are invalid, then the code will automatically return empty vector. Thats fine. But if one is invalid and other is not, then discarding the initial isValid() condition  will cause returning the parameters of valid url. But we agreed to return empty vector if one of the url is invalid. Do you suggest that we should return the valid url's parameter if another is invalid?

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/20210803/14b499a1/attachment-0001.htm>

More information about the webkit-unassigned mailing list