[Webkit-unassigned] [Bug 228122] Expand URL class query parameter functions
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Jul 30 17:43:15 PDT 2021
https://bugs.webkit.org/show_bug.cgi?id=228122
--- Comment #20 from Risul Islam <risul_islam at apple.com> ---
Comment on attachment 434669
--> https://bugs.webkit.org/attachment.cgi?id=434669
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=434669&action=review
>>>> Source/WTF/ChangeLog:8
>>>> + Added more functionalities for parsing URL query parameters.
>>>
>>> I don’t fully understand why adding more functions that are not yet used is important for WebKIt, but I trust there is some reason.
>>
>> Thank you Darin for your valuable comments and insights. We are trying to come up with a feature that restricts tracking parameters from the URL while loading or sharing by copying. Thats why we are adding the functionalities in this patch.
>
> I'd say "Added parsing of URL query strings."
Great. On it.
>> Tools/TestWebKitAPI/Tests/WTF/URL.cpp:522
>> + EXPECT_EQ(url9.string(), url12.string());
>
> You need to have a section of negative tests, for instance named URLMalformedQueryStrings. There your test things like:
> · http://www.webkit.org/??
> · http://www.webkit.org/?/?test=test
> · http://www.webkit.org/?=test
> · http://www.webkit.org/?==
> · http://www.webkit.org/?=?
> · http://www.webkit.org/=?
> · http://www.webkit.org??
> · http://www.webkit.org?/?test=test
> · http://www.webkit.org?=test
> · http://www.webkit.org?==
> · http://www.webkit.org?=?
> · http://www.webkit.org=?
We assumed that the first '?' is the start of the query string. Then the query parameters are separated by '&' and finally parameter key and value is separated by '=' . Since there is no standard we got this assumption from
https://www.freeformatter.com/url-parser-query-string-splitter.html
There are some test cases added for the above kinds of URLs. Do we want more tests?
--
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/20210731/d6884545/attachment.htm>
More information about the webkit-unassigned
mailing list