Re: Reproducable apache 1.3.26 /modproxy issue viewing www.kbb.com

Geff <[email protected]>
Newsgroups gmane.comp.apache.mod-proxy
Message-ID <[email protected]>
I've written a patch that seems to address the problem.

I just wanted others to have the option to apply it.  I think it's
ridiculous to have to break apache, an RFC compliant server to be able
to view a website.  But what am I going to do about it? :)  The truth is
the patch should remove ANY entity-header variable.  But I only chose to
deal with the Content-Length variable in the short term.

Comments are welcome as always.

Enjoy,

Geff

On Mon, 2002-08-12 at 11:47, Graham Leggett wrote:
> Geff wrote:
> 
> > I'd also like to say that this issue doesn't just affect the 'no-cache'
> > case but it also seems to affect the case when the cache decides it
> > needs to revalidate a resource with the original server.  The 'no-cache'
> > method is just a convenient way to demonstrate the problem and force the
> > cache to try to revalidate the resource.
> 
>  From what I understand this is caused by some buggy versions of IIS v5 
> which send Content-Length: 0 along with 304 responses.
> 
> Regards,
> Graham
> -- 
> -----------------------------------------
> [email protected] 
> 	"There's a moon
> 					over Bourbon Street
> 						tonight..."
>
cl.patch (text/x-patch, 795 B)
*** /home/boing/apache_1.3.26/src/modules/proxy/proxy_cache.c	Mon Aug 12 17:20:58 2002
--- proxy_cache.c	Mon Aug 12 17:43:03 2002
***************
*** 1519,1524 ****
--- 1519,1530 ----
          ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, r->server, "Expiry date calculated %ld", (long)expc);
      }
  
+ /* Accommodate BUSTED IIS servers.  Microsoft can't seem to pay attention to RFC 2616.
+  * When sending a response of code 304 (HTTP_NOT_MODIFIED) you cannot send any 
+  * entity-header variables.  This patch deletes only the Content-Length variable. */
+     if (r->status == HTTP_NOT_MODIFIED) {
+         ap_table_unset(resp_hdrs,"Content-Length");
+     }
  /* get the content-length header */
      clen = ap_table_get(resp_hdrs, "Content-Length");
      if (clen == NULL)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.