Changeset 139883 in webkit


Ignore:
Timestamp:
Jan 16, 2013 8:00:38 AM (11 years ago)
Author:
caseq@chromium.org
Message:

Web Inspector: cookies with empty value are parsed incorrectly
https://bugs.webkit.org/show_bug.cgi?id=107012

Reviewed by Pavel Feldman.

Source/WebCore:

Require cookie value to be a string, not a non-empty string, before
employing legacy compatibility hack of treating bare token as value
for the cookie with an empty name.

  • inspector/front-end/CookieParser.js:

(WebInspector.CookieParser.prototype._addCookie):

LayoutTests:

  • inspector/cookie-parser-expected.txt:
  • inspector/cookie-parser.html:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r139881 r139883  
     12013-01-16  Andrey Kosyakov  <caseq@chromium.org>
     2
     3        Web Inspector: cookies with empty value are parsed incorrectly
     4        https://bugs.webkit.org/show_bug.cgi?id=107012
     5
     6        Reviewed by Pavel Feldman.
     7
     8        * inspector/cookie-parser-expected.txt:
     9        * inspector/cookie-parser.html:
     10
    1112013-01-16  Andrey Lushnikov  <lushnikov@chromium.org>
    212
  • trunk/LayoutTests/inspector/cookie-parser-expected.txt

    r129118 r139883  
    131131    secure : undefined
    132132}
     133source: cooke1; Path=/; Domain=.example.com;
     134name: , value: cooke1, httpOnly: false, secure: false, session: true, path: /, domain: .example.com, port: undefined, expires: n/a, size: 36
     135{
     136    domain : ".example.com"
     137    path : "/"
     138}
     139source: cooke1=; Path=/; Domain=.example.com;
     140name: cooke1, value: , httpOnly: false, secure: false, session: true, path: /, domain: .example.com, port: undefined, expires: n/a, size: 37
     141{
     142    domain : ".example.com"
     143    path : "/"
     144}
    133145
  • trunk/LayoutTests/inspector/cookie-parser.html

    r137585 r139883  
    6161    InspectorTest.parseAndDumpSetCookie("cooke1 = value; expires = Mon, Oct 18 2010 17:00 GMT+0000; Domain   =.example.com\nCookie2 = value2; Path = /foo; DOMAIN = foo.example.com; HttpOnly; Secure; Discard;");
    6262    InspectorTest.parseAndDumpSetCookie("cooke1 = value; max-age= 1440; Domain   =.example.com\n Cookie2 = value2; Path = /foo; DOMAIN = foo.example.com; HttpOnly; Secure; Discard;");
     63    InspectorTest.parseAndDumpSetCookie("cooke1; Path=/; Domain=.example.com;");
     64    InspectorTest.parseAndDumpSetCookie("cooke1=; Path=/; Domain=.example.com;");
    6365    InspectorTest.completeTest();
    6466}
  • trunk/Source/WebCore/ChangeLog

    r139882 r139883  
     12013-01-16  Andrey Kosyakov  <caseq@chromium.org>
     2
     3        Web Inspector: cookies with empty value are parsed incorrectly
     4        https://bugs.webkit.org/show_bug.cgi?id=107012
     5
     6        Reviewed by Pavel Feldman.
     7
     8        Require cookie value to be a string, not a non-empty string, before
     9        employing legacy compatibility hack of treating bare token as value
     10        for the cookie with an empty name.
     11
     12        * inspector/front-end/CookieParser.js:
     13        (WebInspector.CookieParser.prototype._addCookie):
     14
    1152013-01-16  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
    216
  • trunk/Source/WebCore/inspector/front-end/CookieParser.js

    r137585 r139883  
    172172        // Mozilla bug 169091: Mozilla, IE and Chrome treat single token (w/o "=") as
    173173        // specifying a value for a cookie with empty name.
    174         this._lastCookie = keyValue.value ? new WebInspector.Cookie(keyValue.key, keyValue.value, type) :
     174        this._lastCookie = typeof keyValue.value === "string" ? new WebInspector.Cookie(keyValue.key, keyValue.value, type) :
    175175            new WebInspector.Cookie("", keyValue.key, type);
    176176        this._lastCookiePosition = keyValue.position;
Note: See TracChangeset for help on using the changeset viewer.