Branch: Tag:

2016-10-06

2016-10-06 10:08:31 by Arne Goedeke <el@laramies.com>

Protocols.HTTP.Session: ignore malformed expiry dates in cookies

442:    foreach (v[1..];;[string what,string value])    switch (lower_case(what))    { -  case "expires": -  expires= +  case "expires": { +  object tmp =    (RUNTIME_RESOLV(Calendar.ISO.parse)("%e, %D %M %Y %h:%m:%s %z",value)||    RUNTIME_RESOLV(Calendar.ISO.parse)("%e, %D-%M-%y %h:%m:%s %z",value) ) -  ->unix_time(); +  /* Some servers send malformed expiry dates. +  * We treat those as if no expiry date had been set */ +  if (tmp) expires=tmp->unix_time();    break; -  +  }    case "path":    path=value;    break;