[webkit-reviews] review requested: [Bug 211358] A URL cannot have a username/password/port if its host is null : [Attachment 398327] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 4 09:55:38 PDT 2020


Rob Buis <rbuis at igalia.com> has asked  for review:
Bug 211358: A URL cannot have a username/password/port if its host is null
https://bugs.webkit.org/show_bug.cgi?id=211358

Attachment 398327: Patch

https://bugs.webkit.org/attachment.cgi?id=398327&action=review




--- Comment #6 from Rob Buis <rbuis at igalia.com> ---
Comment on attachment 398327
  --> https://bugs.webkit.org/attachment.cgi?id=398327
Patch

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

>>> Source/WTF/wtf/URL.cpp:453
>>> +	 if (hostStart() == m_hostEnd || protocolIs("file"))
>> 
>> Ok as-is. No change needed. Spec also mentions about checking
cannot-be-a-base-URL flag. This is equivalent to checking !isHierarchical()
(very quick read + intuition) and the optimal solution would do that. <---
function assets there is :, which I think is covered by m_isValid. If not, then
need to check that too to avoid the assert triggering in debug.
> 
> Also optimal solution is to move this check into a private member  function
marked inline in .cpp instead of duplicating it, especially if the check will
have 3 disjunction <-- meaning it's becoming complicated.

Thanks for the review! Today I found out cannot-be-a-base-URL is already
handled in URLDecomposition, so I moved my code there.


More information about the webkit-reviews mailing list