benluteijn / cherokee

Automatically exported from code.google.com/p/cherokee
0 stars 1 forks source link

Reverse proxy and the content-length header #225

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When I configure a backend http server that replies with a content-length
header, the reverse proxy replies with these headers (nb: ignore the http
status, that was expected):

HTTP/1.1 404 Not Found
Connection: Keep-Alive
Keep-Alive: timeout=60
Transfer-Encoding: chunked
Date: Sat, 15 Nov 2008 18:32:13 GMT
Content-length: 173
Content-type: text/html
Server: TwistedWeb/8.1.0

As you can see there is a "content-length" and a "transfer-encoding"
header.  Only one of those should be there.  Because of this (I think),
firefox seems to stall (always displays the "busy" indicator).

Original issue reported on code.google.com by rgl%ruil...@gtempaccount.com on 15 Nov 2008 at 7:52

GoogleCodeExporter commented 9 years ago

Original comment by alobbs on 15 Nov 2008 at 7:53

GoogleCodeExporter commented 9 years ago
I have just tested during a couple of web servers. The first one was serving 
static content:

  cherokee -r . -p 9090

and the other one was using this configuration file:

-----
server!port = 1234

vserver!1!nick = default
vserver!1!document_root = /tmp
vserver!1!rule!1!match = default
vserver!1!rule!1!handler = proxy
vserver!1!rule!1!handler!header_hide!1 = server
vserver!1!rule!1!handler!balancer = round_robin
vserver!1!rule!1!handler!balancer!source!1 = 1

source!1!type = host
source!1!host = localhost:9090
-----

This was the output when I requested something to the static content server:

-----
> GET /avl.h HTTP/1.1
> User-Agent: curl/7.19.0 (i386-apple-darwin9.5.0) libcurl/7.19.0 
OpenSSL/0.9.7l zlib/1.2.3
> Host: localhost:9090
> Accept: */*
> 
< HTTP/1.1 200 OK
< Connection: Keep-Alive
< Keep-Alive: timeout=5
< Date: Mon, 17 Nov 2008 17:10:27 GMT
< Server: Cherokee/0.11.0b2419 (UNIX)
< ETag: 48d10966=a88
< Last-Modified: Wed, 17 Sep 2008 13:43:02 GMT
< Content-Length: 2696
-----

and this was the reply of the proxy:

-----
> GET /avl.h HTTP/1.1
> User-Agent: curl/7.19.0 (i386-apple-darwin9.5.0) libcurl/7.19.0 
OpenSSL/0.9.7l zlib/1.2.3
> Host: localhost:1234
> Accept: */*
> 
< HTTP/1.1 200 OK
< Connection: Keep-Alive
< Keep-Alive: timeout=5
< Keep-Alive: timeout=5
< Date: Mon, 17 Nov 2008 17:14:02 GMT
< ETag: 48d10966=a88
< Last-Modified: Wed, 17 Sep 2008 13:43:02 GMT
< Content-Length: 2696
-----

Besides the duped header, everything else was alright. (I'll take care of the 
duped header now).

Original comment by alobbs on 17 Nov 2008 at 5:16

GoogleCodeExporter commented 9 years ago
Rui, could you please check whether this was fixed in 0.11.2?

Original comment by alobbs on 1 Dec 2008 at 2:03

GoogleCodeExporter commented 9 years ago
Tested. It's fixed.

Rui, Thanks for reporting! :-)

Original comment by alobbs on 5 Dec 2008 at 9:01