<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>24656</bug_id>
          
          <creation_ts>2009-03-17 15:58:49 -0700</creation_ts>
          <short_desc>cacheControlContainsNoCache() in ResourceResponseBase.h is wrong</short_desc>
          <delta_ts>2009-04-10 08:34:17 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Page Loading</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Grace Kloba">klobag</reporter>
          <assigned_to name="Alexey Proskuryakov">ap</assigned_to>
          <cc>ap</cc>
    
    <cc>darin</cc>
    
    <cc>ddkilzer</cc>
    
    <cc>fishd</cc>
    
    <cc>klobag</cc>
    
    <cc>koivisto</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>114120</commentid>
    <comment_count>0</comment_count>
    <who name="Grace Kloba">klobag</who>
    <bug_when>2009-03-17 15:58:49 -0700</bug_when>
    <thetext>Here is the code,

    bool cacheControlContainsNoCache() const
    {
        if (!m_haveParsedCacheControl)
            parseCacheControlDirectives();
        return m_m_cacheControlContainsMustRevalidate;
    }

We should return m_cacheControlContainsNoCache instead</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114148</commentid>
    <comment_count>1</comment_count>
    <who name="Grace Kloba">klobag</who>
    <bug_when>2009-03-17 18:14:40 -0700</bug_when>
    <thetext>Another bug in the cpp file, ResourceResponseBase::parseCacheControlDirectives().

        if ((equalIgnoringCase(directives[i].first, &quot;private&quot;) || equalIgnoringCase(directives[i].first, &quot;no-cache&quot;)) &amp;&amp; !directives[i].second.isEmpty())
            parseCacheControlDirectiveValues(directives[i].second, directiveValues);
        else
            directiveValues.append(directives[i].second);

I think the else should append directives[i].first as directives[i].second is empty.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114161</commentid>
    <comment_count>2</comment_count>
      <attachid>28717</attachid>
    <who name="Grace Kloba">klobag</who>
    <bug_when>2009-03-17 19:39:54 -0700</bug_when>
    <thetext>Created attachment 28717
patch to fix the bug</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114165</commentid>
    <comment_count>3</comment_count>
      <attachid>28717</attachid>
    <who name="Sam Weinig">sam</who>
    <bug_when>2009-03-17 22:48:14 -0700</bug_when>
    <thetext>Comment on attachment 28717
patch to fix the bug

If you would like to put something up for review, you need to set the review flag to ?.  

This needs test cases, so r-.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114226</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-03-18 13:52:12 -0700</bug_when>
    <thetext>Hmm, this may be quite tricky to test for.

A test could use a stateful script that would return different resource content each time, see e.g. http/tests/resources/network-simulator.php.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114244</commentid>
    <comment_count>5</comment_count>
    <who name="Grace Kloba">klobag</who>
    <bug_when>2009-03-18 15:57:23 -0700</bug_when>
    <thetext>I found network-simulator.php too by searching &quot;no-store&quot;. But I can&apos;t find the old test case when the code was added.

It is really fixing a typo.

Will work on a test case later.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>115724</commentid>
    <comment_count>6</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-03-29 06:03:58 -0700</bug_when>
    <thetext>OK, I guess it&apos;s a bit unfair to strictly require tests, given that we&apos;ve let the original patch in with no tests at all. But it also means that the tests are so much more important!

&gt;          if ((equalIgnoringCase(directives[i].first, &quot;private&quot;) || equalIgnoringCase(directives[i].first, &quot;no-cache&quot;)) &amp;&amp; !directives[i].second.isEmpty())
&gt;              parseCacheControlDirectiveValues(directives[i].second, directiveValues);
&gt;          else
&gt; -            directiveValues.append(directives[i].second);
&gt; +            directiveValues.append(directives[i].first);

This code looks busted in many more ways, and I don&apos;t think that it&apos;s very desirable to only fix one minor case. All this check does is stuff Cache-Control private and no-cache directive values into one bucket with other directives, which looks bogus. E.g., one possible use of this syntax is &apos;Cache-Control: no-cache=&quot;X-Foobar&quot;&apos;, which means that &apos;X-Foobar&apos; header must not be sent in a proxy response without revalidation.

According to svn blame, this code was added in &lt;http://trac.webkit.org/changeset/38145&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>115737</commentid>
    <comment_count>7</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2009-03-29 09:46:37 -0700</bug_when>
    <thetext>(In reply to comment #6)

&gt; &gt;          if ((equalIgnoringCase(directives[i].first, &quot;private&quot;) || equalIgnoringCase(directives[i].first, &quot;no-cache&quot;)) &amp;&amp; !directives[i].second.isEmpty())
&gt; &gt;              parseCacheControlDirectiveValues(directives[i].second, directiveValues);
&gt; &gt;          else
&gt; &gt; -            directiveValues.append(directives[i].second);
&gt; &gt; +            directiveValues.append(directives[i].first);
&gt; 
&gt; This code looks busted in many more ways, and I don&apos;t think that it&apos;s very
&gt; desirable to only fix one minor case. All this check does is stuff
&gt; Cache-Control private and no-cache directive values into one bucket with other
&gt; directives, which looks bogus. E.g., one possible use of this syntax is
&gt; &apos;Cache-Control: no-cache=&quot;X-Foobar&quot;&apos;, which means that &apos;X-Foobar&apos; header must
&gt; not be sent in a proxy response without revalidation.

The &quot;private&quot; and &quot;no-cache&quot; directive values are NOT put into a single bucket.  You must read the second if/else statement below it to see how the directiveValues data is used.  The check for &quot;private&quot; or &quot;no-cache&quot; in the code above is because the spec says that they are the only directives that may have one or more sub-values, so they are parsed differently than other directives.  (But the code inside the outer for loop handles directives with and without sub-values, which may be why it&apos;s confusing.)

See Section 14.9 in &lt;http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>115743</commentid>
    <comment_count>8</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2009-03-29 10:05:49 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; (In reply to comment #6)
&gt; 
&gt; &gt; &gt;          if ((equalIgnoringCase(directives[i].first, &quot;private&quot;) || equalIgnoringCase(directives[i].first, &quot;no-cache&quot;)) &amp;&amp; !directives[i].second.isEmpty())
&gt; &gt; &gt;              parseCacheControlDirectiveValues(directives[i].second, directiveValues);
&gt; &gt; &gt;          else
&gt; &gt; &gt; -            directiveValues.append(directives[i].second);
&gt; &gt; &gt; +            directiveValues.append(directives[i].first);
&gt; &gt; 
&gt; &gt; This code looks busted in many more ways, and I don&apos;t think that it&apos;s very
&gt; &gt; desirable to only fix one minor case. All this check does is stuff
&gt; &gt; Cache-Control private and no-cache directive values into one bucket with other
&gt; &gt; directives, which looks bogus. E.g., one possible use of this syntax is
&gt; &gt; &apos;Cache-Control: no-cache=&quot;X-Foobar&quot;&apos;, which means that &apos;X-Foobar&apos; header must
&gt; &gt; not be sent in a proxy response without revalidation.
&gt; 
&gt; The &quot;private&quot; and &quot;no-cache&quot; directive values are NOT put into a single bucket.
&gt;  You must read the second if/else statement below it to see how the
&gt; directiveValues data is used.  The check for &quot;private&quot; or &quot;no-cache&quot; in the
&gt; code above is because the spec says that they are the only directives that may
&gt; have one or more sub-values, so they are parsed differently than other
&gt; directives.  (But the code inside the outer for loop handles directives with
&gt; and without sub-values, which may be why it&apos;s confusing.)

I remember now, the parsing code was changed in r39383 because fully parsing the cache-control headers was a memory regression:

&lt;http://trac.webkit.org/changeset/39383&gt;

The original code I committed in r38145 did do correct parsing of those headers.

-            directiveValues.append(directives[i].second);
+            directiveValues.append(directives[i].first);

This change is incorrect.

-        return m_cacheControlContainsMustRevalidate;
+        return m_cacheControlContainsNoCache;

This change is correct and fixes a copy-paste error in cacheControlContainsNoCache().

If more detail is needed for Cache-Control headers (after r39383), you&apos;ll have to modify the parsing routines to check for what you&apos;re looking for and stuff it into a 1-bit bool field or return the data on an as-needed basis.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>115744</commentid>
    <comment_count>9</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-03-29 10:08:31 -0700</bug_when>
    <thetext>Dave, please check how the current code handles e.g. &quot;Cache-Control: private=must-revalidate&quot; - instead of treating must-revalidate as a header name, it sets m_cacheControlContainsMustRevalidate to true.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>115753</commentid>
    <comment_count>10</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2009-03-29 12:05:27 -0700</bug_when>
    <thetext>(In reply to comment #9)
&gt; Dave, please check how the current code handles e.g. &quot;Cache-Control:
&gt; private=must-revalidate&quot; - instead of treating must-revalidate as a header
&gt; name, it sets m_cacheControlContainsMustRevalidate to true.

Yep, I agree that this broke in r39383.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>115755</commentid>
    <comment_count>11</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2009-03-29 12:12:04 -0700</bug_when>
    <thetext>(In reply to comment #10)
&gt; (In reply to comment #9)
&gt; &gt; Dave, please check how the current code handles e.g. &quot;Cache-Control:
&gt; &gt; private=must-revalidate&quot; - instead of treating must-revalidate as a header
&gt; &gt; name, it sets m_cacheControlContainsMustRevalidate to true.
&gt; 
&gt; Yep, I agree that this broke in r39383.

This is still the incorrect fix:

-            directiveValues.append(directives[i].second);
+            directiveValues.append(directives[i].first);

Basically, the for() loop in ResourceResponseBase::parseCacheControlDirectives() that was added in r39383 needs to be fixed so it&apos;s checking for the must-revalidate keyword instead of a sub-value of a &quot;private&quot; or &quot;no-cache&quot; directive.

I&apos;ll try to fix this soon-ish.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116870</commentid>
    <comment_count>12</comment_count>
      <attachid>29331</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-04-08 06:22:43 -0700</bug_when>
    <thetext>Created attachment 29331
proposed fix

Let&apos;s get this fixed, at last.

I&apos;m actually not sure if a test can be made for this bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116878</commentid>
    <comment_count>13</comment_count>
      <attachid>29331</attachid>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2009-04-08 07:31:29 -0700</bug_when>
    <thetext>Comment on attachment 29331
proposed fix

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116879</commentid>
    <comment_count>14</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-04-08 07:36:55 -0700</bug_when>
    <thetext>Committed &lt;http://trac.webkit.org/changeset/42319&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116906</commentid>
    <comment_count>15</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2009-04-08 11:01:06 -0700</bug_when>
    <thetext>Cache-control: no-cache=&quot;set-cookie&quot; is actually quite common.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116911</commentid>
    <comment_count>16</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2009-04-08 11:54:25 -0700</bug_when>
    <thetext>(In reply to comment #15)
&gt; Cache-control: no-cache=&quot;set-cookie&quot; is actually quite common.

Darin, please file a new bug.  Thanks!
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116996</commentid>
    <comment_count>17</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-04-08 23:10:29 -0700</bug_when>
    <thetext>(In reply to comment #15)
&gt; Cache-control: no-cache=&quot;set-cookie&quot; is actually quite common.

What is the practical difference between no-cache and no-cache=&quot;set-cookie&quot;? RFC 2616 seems to say that it&apos;s up to the cache to decide whether to send a cached response with Set-Cookie omitted, or to revalidate, which sounds confusing to me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116998</commentid>
    <comment_count>18</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2009-04-09 01:31:09 -0700</bug_when>
    <thetext>&gt; What is the practical difference between no-cache and no-cache=&quot;set-cookie&quot;?

no-cache applies to the response body, no-cache=&quot;set-cookie&quot; only applies to the set-cookie response header.  practically speaking, no-cache=&quot;set-cookie&quot; means that you should strip that cookie out when storing the response in the cache.  otherwise, the response is totally cacheable.  (in general, browser caches strip out set-cookie, but i guess there is probably some app server out there that likes to make sure... perhaps as information to proxy caches.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117027</commentid>
    <comment_count>19</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-04-09 05:25:19 -0700</bug_when>
    <thetext>(In reply to comment #18)
&gt; practically speaking, no-cache=&quot;set-cookie&quot;
&gt; means that you should strip that cookie out when storing the response in the
&gt; cache. 

What should the cache return when asked for this resource? It doesn&apos;t sound like returning a response without one of the headers makes much sense.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117047</commentid>
    <comment_count>20</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2009-04-09 10:51:51 -0700</bug_when>
    <thetext>&gt; What should the cache return when asked for this resource? It doesn&apos;t sound
&gt; like returning a response without one of the headers makes much sense.

That&apos;s what it means.  Think of it as a way for servers to specify that some information should be considered transient or private (can make good sense for set-cookie).  HTTP caches also strip other transient (hop-by-hop) headers like Connection, etc.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117050</commentid>
    <comment_count>21</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2009-04-09 10:57:34 -0700</bug_when>
    <thetext>From RFC 2616 section 14.9.1:

  If the no-cache directive does specify one or more field-names,
  then a cache MAY use the response to satisfy a subsequent request,
  subject to any other restrictions on caching. However, the
  specified field-name(s) MUST NOT be sent in the response to a
  subsequent request without successful revalidation with the origin
  server. This allows an origin server to prevent the re-use of
  certain header fields in a response, while still allowing caching
  of the rest of the response.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117063</commentid>
    <comment_count>22</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-04-09 12:40:48 -0700</bug_when>
    <thetext>(In reply to comment #21)
&gt; From RFC 2616 section 14.9.1:

Yes, that&apos;s exactly the part that I was talking about. What confuses me is that a response that had a Set-Cookie header when sent to the first client is one that more than likely needs to have it when sent to other clients - it should obviously be different, but not missing. Is there a use case where a missing Set-Cookie header is fine?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117077</commentid>
    <comment_count>23</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2009-04-09 14:53:23 -0700</bug_when>
    <thetext>&gt; obviously be different, but not missing. Is there a use case where a missing
&gt; Set-Cookie header is fine?

Perhaps a web developer might assume that the cookie would persist in the cookie database.  One might need to combine this with cache-control: private to avoid strange proxy effects.  Of course, the cookie could be absent in the cookie db :/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117083</commentid>
    <comment_count>24</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2009-04-09 15:18:49 -0700</bug_when>
    <thetext>(In reply to comment #23)
&gt; &gt; obviously be different, but not missing. Is there a use case where a missing
&gt; &gt; Set-Cookie header is fine?
&gt; 
&gt; Perhaps a web developer might assume that the cookie would persist in the
&gt; cookie database.  One might need to combine this with cache-control: private to
&gt; avoid strange proxy effects.  Of course, the cookie could be absent in the
&gt; cookie db :/

I don&apos;t understand how caching http proxy behavior applies to a web browser.  Once the http request hits the browser, cookies have a different set of rules determining their cached lifetime than resources do.  I don&apos;t see where no-cache=&quot;set-cookie&quot; would have any bearing on a web browser.

Or is Chrome&apos;s cache set up like a caching http proxy such that it needs to know when it can replay certain headers to each subprocess?
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117092</commentid>
    <comment_count>25</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2009-04-09 15:36:36 -0700</bug_when>
    <thetext>no, chrome&apos;s network stack does not act like a proxy.  sorry to confuse matters.  i mentioned proxies because that is something that web developers have to sometimes think about.

i brought up the example of no-cache=&quot;set-cookie&quot; because i have seen those in the wild.  i&apos;m only guessing why web developers (or more likely some web app engine) might want to send that in the response headers.

most browsers do not store set-cookie response headers in the cache anyways, so this particular response header (no-cache=&quot;set-cookie&quot;) should indeed be irrelevant to browsers.

however, what i found is that because no-cache=&quot;set-cookie&quot; is common, if you do not discern no-cache=&quot;foo&quot; from no-cache, then you will miss out on being able to cache a lot of content on the web.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117100</commentid>
    <comment_count>26</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2009-04-09 16:10:31 -0700</bug_when>
    <thetext>(In reply to comment #25)
&gt; however, what i found is that because no-cache=&quot;set-cookie&quot; is common, if you
&gt; do not discern no-cache=&quot;foo&quot; from no-cache, then you will miss out on being
&gt; able to cache a lot of content on the web.

I see, so no-cache=&quot;set-cookie&quot; should not prevent content from being cached.

(In reply to comment #16)
&gt; Darin, please file a new bug.  Thanks!

Pretty please?  :)
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117122</commentid>
    <comment_count>27</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2009-04-09 22:52:13 -0700</bug_when>
    <thetext>&gt; I see, so no-cache=&quot;set-cookie&quot; should not prevent content from being cached.

Right.


&gt; (In reply to comment #16)
&gt; &gt; Darin, please file a new bug.  Thanks!
&gt; 
&gt; Pretty please?  :)

Sorry, I missed that comment before.  See bug 25129.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117138</commentid>
    <comment_count>28</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-04-10 02:16:49 -0700</bug_when>
    <thetext>(In reply to comment #23)
&gt; Perhaps a web developer might assume that the cookie would persist in the
&gt; cookie database.  One might need to combine this with cache-control: private to
&gt; avoid strange proxy effects.

AFAICT cache-control: private also makes no-cache=&quot;set-cookie&quot; unnecessary. So, I&apos;m still confused about the utility of such directive, but it does seem like we should not treat it as no-cache indeed. Have you ever seen no-cache=... with other header names in practice? Set-cookie2 maybe?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117145</commentid>
    <comment_count>29</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2009-04-10 08:34:17 -0700</bug_when>
    <thetext>&gt; AFAICT cache-control: private also makes no-cache=&quot;set-cookie&quot; unnecessary. So,
&gt; I&apos;m still confused about the utility of such directive, but it does seem like
&gt; we should not treat it as no-cache indeed. Have you ever seen no-cache=... with
&gt; other header names in practice? Set-cookie2 maybe?

Using a tool I know of to search the web, I found some instances of cache-control no-cache=&quot;set-cookie,set-cookie2&quot;.  I see no-cache=&quot;server&quot; here: http://www.w3.org/Protocols/HTTP/Issues/cachedirective.txt</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>28717</attachid>
            <date>2009-03-17 19:39:54 -0700</date>
            <delta_ts>2009-04-08 06:22:43 -0700</delta_ts>
            <desc>patch to fix the bug</desc>
            <filename>patch.txt</filename>
            <type>text/plain</type>
            <size>2248</size>
            <attacher name="Grace Kloba">klobag</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0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TsKSW5kZXg6
IFdlYkNvcmUvcGxhdGZvcm0vbmV0d29yay9SZXNvdXJjZVJlc3BvbnNlQmFzZS5oCj09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT0KLS0tIFdlYkNvcmUvcGxhdGZvcm0vbmV0d29yay9SZXNvdXJjZVJlc3BvbnNlQmFzZS5oCShy
ZXZpc2lvbiA0MTc5NikKKysrIFdlYkNvcmUvcGxhdGZvcm0vbmV0d29yay9SZXNvdXJjZVJlc3Bv
bnNlQmFzZS5oCSh3b3JraW5nIGNvcHkpCkBAIC04OCw3ICs4OCw3IEBAIHB1YmxpYzoKICAgICB7
CiAgICAgICAgIGlmICghbV9oYXZlUGFyc2VkQ2FjaGVDb250cm9sKQogICAgICAgICAgICAgcGFy
c2VDYWNoZUNvbnRyb2xEaXJlY3RpdmVzKCk7Ci0gICAgICAgIHJldHVybiBtX2NhY2hlQ29udHJv
bENvbnRhaW5zTXVzdFJldmFsaWRhdGU7CisgICAgICAgIHJldHVybiBtX2NhY2hlQ29udHJvbENv
bnRhaW5zTm9DYWNoZTsKICAgICB9CiAgICAgYm9vbCBjYWNoZUNvbnRyb2xDb250YWluc011c3RS
ZXZhbGlkYXRlKCkgY29uc3QKICAgICB7Cg==
</data>
<flag name="review"
          id="14152"
          type_id="1"
          status="-"
          setter="sam"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>29331</attachid>
            <date>2009-04-08 06:22:43 -0700</date>
            <delta_ts>2009-04-08 07:31:29 -0700</delta_ts>
            <desc>proposed fix</desc>
            <filename>CacheControlParsing.txt</filename>
            <type>text/plain</type>
            <size>3836</size>
            <attacher name="Alexey Proskuryakov">ap</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT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ldLnN0cmlwV2hpdGVTcGFjZSgpOwotfQotCiB9CkluZGV4OiBXZWJDb3Jl
L3BsYXRmb3JtL25ldHdvcmsvUmVzb3VyY2VSZXNwb25zZUJhc2UuaAo9PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBX
ZWJDb3JlL3BsYXRmb3JtL25ldHdvcmsvUmVzb3VyY2VSZXNwb25zZUJhc2UuaAkocmV2aXNpb24g
NDIzMTMpCisrKyBXZWJDb3JlL3BsYXRmb3JtL25ldHdvcmsvUmVzb3VyY2VSZXNwb25zZUJhc2Uu
aAkod29ya2luZyBjb3B5KQpAQCAtODgsNyArODgsNyBAQCBwdWJsaWM6CiAgICAgewogICAgICAg
ICBpZiAoIW1faGF2ZVBhcnNlZENhY2hlQ29udHJvbCkKICAgICAgICAgICAgIHBhcnNlQ2FjaGVD
b250cm9sRGlyZWN0aXZlcygpOwotICAgICAgICByZXR1cm4gbV9jYWNoZUNvbnRyb2xDb250YWlu
c011c3RSZXZhbGlkYXRlOworICAgICAgICByZXR1cm4gbV9jYWNoZUNvbnRyb2xDb250YWluc05v
Q2FjaGU7CiAgICAgfQogICAgIGJvb2wgY2FjaGVDb250cm9sQ29udGFpbnNNdXN0UmV2YWxpZGF0
ZSgpIGNvbnN0CiAgICAgewo=
</data>
<flag name="review"
          id="14576"
          type_id="1"
          status="+"
          setter="ddkilzer"
    />
          </attachment>
      

    </bug>

</bugzilla>