[webkit-reviews] review granted: [Bug 226760] Origin is null in http requests when baseURL has custom scheme on iOS 15.0 : [Attachment 431049] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 9 22:11:45 PDT 2021


Chris Dumez <cdumez at apple.com> has granted Alex Christensen
<achristensen at apple.com>'s request for review:
Bug 226760: Origin is null in http requests when baseURL has custom scheme on
iOS 15.0
https://bugs.webkit.org/show_bug.cgi?id=226760

Attachment 431049: Patch

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




--- Comment #4 from Chris Dumez <cdumez at apple.com> ---
Comment on attachment 431049
  --> https://bugs.webkit.org/attachment.cgi?id=431049
Patch

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

R=me with the change

>> Source/WebCore/page/SecurityOrigin.h:280
>> +	origin->m_data = WTFMove(*data);
> 
> I have read your change log twice and I still don’t understand this change.
It looks suspicious to set the securityorigindata (which is protocol / host /
port) right after constructing a security origin with those same protocol /
host / port.

I looked at the create() function and it looks like it constructs a url from
the components, only to then later on extract the components from the URL :(
this is a bit unfortunate. I think your change would probably look better if
you did:
auto origin = adoptRef(*new SecurityOrigin);
origin->m_data = WTFMove(*data);

It would also be more efficient.


More information about the webkit-reviews mailing list