Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt IETF's test suite, fix spec and browser compliance errors #30

Merged
merged 23 commits into from
Apr 17, 2015
Merged

Adopt IETF's test suite, fix spec and browser compliance errors #30

merged 23 commits into from
Apr 17, 2015

Commits on Feb 25, 2015

  1. Refactor tests

    inikulin committed Feb 25, 2015
    Configuration menu
    Copy the full SHA
    b8aa8e8 View commit details
    Browse the repository at this point in the history

Commits on Feb 27, 2015

  1. Add IETF's http state tests

    inikulin committed Feb 27, 2015
    Configuration menu
    Copy the full SHA
    1af799c View commit details
    Browse the repository at this point in the history

Commits on Mar 3, 2015

  1. Fix IETF's value parsing tests:

    1)Doubles quotes should be a part of the value (RFC6265 S4.1.1)
    2)"Relaxed" mode should use \r \n\ and \0 as terminators according to Chromium source (https://chromium.googlesource.com/chromium/src.git/+/master/net/cookies/parsed_cookie.cc)
    inikulin committed Mar 3, 2015
    Configuration menu
    Copy the full SHA
    a0ea9d5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b4fbe73 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7b3bbf2 View commit details
    Browse the repository at this point in the history

Commits on Mar 4, 2015

  1. Configuration menu
    Copy the full SHA
    d0fbac6 View commit details
    Browse the repository at this point in the history

Commits on Mar 6, 2015

  1. Fix path matching and default path assignment (BTW it fixes #1 in the…

    … correct way).
    
    According to S5.2.4 we should fallback to the default-path only if the path attribute-value is empty or if the first character is not "/".
    Meanwhile, then we are query cookies from the store we should use path-match algorithm from S5.1.4 instead of path permutation based algorithm.
    inikulin committed Mar 6, 2015
    Configuration menu
    Copy the full SHA
    856ab0b View commit details
    Browse the repository at this point in the history

Commits on Mar 10, 2015

  1. Fix ordering tests: JS new Date() precision was not enough to provide…

    … correct order for the cookies which are set synchronously. So we are using high-resolution time now where possible.
    inikulin committed Mar 10, 2015
    Configuration menu
    Copy the full SHA
    d8a02c1 View commit details
    Browse the repository at this point in the history

Commits on Mar 11, 2015

  1. Configuration menu
    Copy the full SHA
    4be6807 View commit details
    Browse the repository at this point in the history
  2. Fix path parsing: if the path attribute doesn't have value or if the …

    …values is '/' we should fallback to the default-path. Previously code doesn't considered the case then we have two path attributes. Now we always assign null explicitly if the path attribute is empty or '/' (Fixes PATH0030 IETF test)
    inikulin committed Mar 11, 2015
    Configuration menu
    Copy the full SHA
    617a942 View commit details
    Browse the repository at this point in the history

Commits on Mar 12, 2015

  1. Fix date parsing: from RFC6265: year = 2*4DIGIT ( non-digit *OCTET ),…

    … meanwhile previously used regexp doesn't allowed years that starts with zero (e.g. 07). Also, it allowed 3-digits year, which is incorrect
    inikulin committed Mar 12, 2015
    Configuration menu
    Copy the full SHA
    8c65a0b View commit details
    Browse the repository at this point in the history
  2. Fix date parsing:

    According to RFC6265:
     time            = hms-time ( non-digit *OCTET )
     hms-time        = time-field ":" time-field ":" time-field
     time-field      = 1*2DIGIT
    
    Previous regexp doesn't allowed 1 digit minute/second time fields.
    inikulin committed Mar 12, 2015
    Configuration menu
    Copy the full SHA
    d18d6cd View commit details
    Browse the repository at this point in the history
  3. Fix date parsing:

    According to RFC6265  S5.1.1:
      month           = ( "jan" / "feb" / "mar" / "apr" /
                           "may" / "jun" / "jul" / "aug" /
                           "sep" / "oct" / "nov" / "dec" ) *OCTET
    
    So, spec allows suffix for the month.
    inikulin committed Mar 12, 2015
    Configuration menu
    Copy the full SHA
    e58487f View commit details
    Browse the repository at this point in the history
  4. Fix date parsing:

    Use the exact grammar productions from the RFC for the time and day-of-month. Then perform correct validation (e.g. we should fail on "Sat, 15-Apr-17 91:22:33 21:01:22" because first met time token was incorrect. Previous approach just skipped first token, which is incorrect according to the RFC and doesn't matches browser's behavior (see: https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/cookie_util.cc#L189)
    inikulin committed Mar 12, 2015
    Configuration menu
    Copy the full SHA
    d59521b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ecc093b View commit details
    Browse the repository at this point in the history

Commits on Mar 20, 2015

  1. Configuration menu
    Copy the full SHA
    0ecd088 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f9015c7 View commit details
    Browse the repository at this point in the history

Commits on Mar 30, 2015

  1. Fix date parsing:

    Previous algorithm failed at the last day of the current month. This was caused by the fact that setUTCMonth method was used. According to MDN(https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMonth) it accepts two parameters. If second parameter (dayValue) is not specified then V8 uses current day value. So if you are setting April as month, and current system date is March 31 then if will be resolved as May 1 which doesn't works for us. Therefore, we will parse tokens separately and then create new Date() object using Date.UTC()
    inikulin committed Mar 30, 2015
    Configuration menu
    Copy the full SHA
    553d20b View commit details
    Browse the repository at this point in the history

Commits on Mar 31, 2015

  1. Configuration menu
    Copy the full SHA
    3b11467 View commit details
    Browse the repository at this point in the history
  2. Fix date parsing:

    Previous algorithm failed at the last day of the current month. This was caused by the fact that setUTCMonth method was used. According to MDN(https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setUTCMonth) it accepts two parameters. If second parameter (dayValue) is not specified then V8 uses current day value. So if you are setting April as month, and current system date is March 31 then if will be resolved as May 1 which doesn't works for us. Therefore, we will parse tokens separately and then create new Date() object using Date.UTC()
    inikulin committed Mar 31, 2015
    Configuration menu
    Copy the full SHA
    fa82ce8 View commit details
    Browse the repository at this point in the history
  3. Use another approach to resolve issues with Date() resolution.

    Use runtime creation index instead of hrTime. Track cookie.creation modifications by
    storing original UTC timestamp and comparing it with the actual cookie.creation.getTime().
    If creation date was modified we fallback to the plane dates comparison.
    inikulin committed Mar 31, 2015
    Configuration menu
    Copy the full SHA
    87854a6 View commit details
    Browse the repository at this point in the history
  4. Fix comment typos

    inikulin committed Mar 31, 2015
    Configuration menu
    Copy the full SHA
    9408b95 View commit details
    Browse the repository at this point in the history

Commits on Apr 1, 2015

  1. Add test for the cookieCompare and modification of the cookie.creatio…

    …n (fallback from runtimeIdx)
    inikulin committed Apr 1, 2015
    Configuration menu
    Copy the full SHA
    55b1ffb View commit details
    Browse the repository at this point in the history