Branch: Tag:

2014-11-17

2014-11-17 13:52:22 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Protocol Cache: Assume that vary is supported by all.

This change is to avoid the vary header on User-Agent, which was
generated by the CookieJar.

Removes the workaround for MSIE 6 having broken support for vary.

900:   // Kludge for resolver problems   static function _charset_decoder_func;    - // NB: This function is used as a vary callback. Thus: - // * It must not be defined in RequestID below, as - // then the protocol cache would hold references - // to old requests. - // * The somewhat odd arguments and return value. - string browser_supports_vary(string ignored, RequestID id) - { -  int i; -  // Vary doesn't work in MSIE <= 6. -  if ((i = search(id->client||({}), "MSIE")) >= 0) { -  int msie_major; -  if (sizeof(id->client) > ++i) { -  sscanf(id->client[i], "%d", msie_major); -  } -  // FIXME: Does it really work in MSIE 7? -  if (msie_major < 7) return "0"; -  } -  return "1"; - } -  +    class RequestID   //! @appears RequestID   //! The request information object contains all request-local information and
1139:    if (supports && zero_type(eaten[cookie])) {    VARY_WERROR("Looking at cookie %O from %s\n",    cookie, describe_backtrace(({backtrace()[-2]}))); -  /* Workaround for MSIE 6's refusal to cache anything with -  * a Vary:Cookie header. -  */ -  register_vary_callback("user-agent", browser_supports_vary); -  if (supports->vary) { +     register_vary_callback("cookie", Roxen->get_cookie_callback(cookie)); -  } else { -  register_vary_callback("user-agent", -  Roxen->get_cookie_callback(cookie)); +     } -  } +     return real_cookies[cookie];    }    static string `[](mixed cookie)