[BlackBerry] Parsed Cookie's m_hasDefaultDomain is not needed.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Apr 2012 05:21:50 +0000 (05:21 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Apr 2012 05:21:50 +0000 (05:21 +0000)
commit534c89df5fd4b18893dfef213c5716fa1b42f704
treea5139356913dc39058e5d504fd50439b68ae29f8
parent123aac1ccdc41549eded5f638b8f06ed6d8d9244
[BlackBerry] Parsed Cookie's m_hasDefaultDomain is not needed.
https://bugs.webkit.org/show_bug.cgi?id=82830

Patch by Jason Liu <jason.liu@torchmobile.com.cn> on 2012-04-18
Reviewed by George Staikos.

Source/WebCore:

RFC 2965
3.2.2
Domain = value
If an explicitly specified value does not start with a dot, the user agent supplies
a leading dot.
3.3.1
Domain  Defaults to the effective request-host.  (Note that because there is no dot
at the beginning of effective request-host, the default Domain can only domain-match
itself.)

The first char can show the difference even though it is from the cookie database.
But m_hasDefaultDomain is set to false if the cookie is from database although the
domain is host as a default value. So m_hasDefaultDomain sometimes is wrong.

In sum,  we shouldn't use m_hasDefaultDomain.

Test: http/tests/security/cookies/cookies-wrong-domain-rejected.php

* platform/blackberry/CookieManager.cpp:
(WebCore::CookieManager::shouldRejectForSecurityReason):
* platform/blackberry/CookieParser.cpp:
(WebCore::CookieParser::parseOneCookie):
* platform/blackberry/ParsedCookie.cpp:
(WebCore::ParsedCookie::ParsedCookie):
* platform/blackberry/ParsedCookie.h:
(ParsedCookie):

LayoutTests:

* http/tests/security/cookies/cookies-wrong-domain-rejected-expected.txt: Added.
* http/tests/security/cookies/cookies-wrong-domain-rejected-result.php: Added.
* http/tests/security/cookies/cookies-wrong-domain-rejected.php: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@114608 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/security/cookies/cookies-wrong-domain-rejected-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/security/cookies/cookies-wrong-domain-rejected-result.php [new file with mode: 0644]
LayoutTests/http/tests/security/cookies/cookies-wrong-domain-rejected.php [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/blackberry/CookieManager.cpp
Source/WebCore/platform/blackberry/CookieParser.cpp
Source/WebCore/platform/blackberry/ParsedCookie.cpp
Source/WebCore/platform/blackberry/ParsedCookie.h