[Webkit-unassigned] [Bug 85028] [BlackBerry] Cookies should be checked during parsing to improve performance.
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sun May 6 18:52:41 PDT 2012
https://bugs.webkit.org/show_bug.cgi?id=85028
--- Comment #5 from Jason <jason.liu at torchmobile.com.cn> 2012-05-06 18:52:40 PST ---
(In reply to comment #3)
> The approach looks good.
>
> size_t dotPosition = parsedValue.find(".", 1);
>
> That looks wrong, though. The original code skipped this check if the domain did not start with a dot. So originally we had (where x is any character that isn't a dot):
>
> .xxxxx - accepted
> .xx.xx - accepted
> xxxxxx - REJECTED
> xxx.xx - accepted
>
> This is the same as searching for the dot from position 0, not 1.
We check if the domain contains an embedded dot.
And originally we had:
.xxxxx - rejected not accepted
.xx.xx - accepted
xxxxxx - REJECTED
xxx.xx - accepted
So this is the same as searching for the dot from 1, not 0.
> Also we have lost this check:
>
> 162 // ignore domain security if protocol doesn't have domains
> 163 if (shouldIgnoreDomain(cookie->protocol()))
> 164 return false;
> 165
If the protocol doesn't have domains, the code path won't contain domain parsing. So drop this "if" check in parsing.
> 166 // Reject Cookie if domain is empty
> 167 if (!cookie->domain().length())
> 168 return true;
>
size_t dotPosition = realDomain.find(".", 1); This is including length check.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list