ESI is generating extraneous output for some clients

Poul-Henning Kamp phk at phk.freebsd.dk
Sun Jun 8 23:09:19 CEST 2008


In message <80a65d4e0806081405v8433ebdibae59f1029b98e2b at mail.gmail.com>, "Adria
no Nagel" writes:
>Hi,
>
>When using ESI (trunk r2652), varnish is adding extraneous characters
>to the output sent to the client, depending on the client being used.
>
>For example, for this html file:
>
><html>
><body>
><h1>Teste ESI 8</h1>
><b><esi:include src="/cgi-bin/date" /></b>
></body>
></html>
>
>and this vcl snippet:
>
>    } elseif (req.url ~ "^/t(este)?.html$") {
>        remove obj.http.Last-Modified;
>        esi;  /* Do ESI processing */
>        set obj.ttl = 1m;
>
>"wget http://localhost/teste.html" generates this output:
>
>26
><html>
><body>
><h1>Teste ESI 8</h1>
><b>
>19
>Sun Jun  8 17:37:43 2008
>
>15
></b>
></body>
></html>
>
>0

When processing ESI documents, Varnish will send "chunked" encoding
and the number lines you see ("26", "19", "15" and "0") are the
chunked headers, they say (in hex) how many characters follow.

So for telnet, the above is absolutely correct, but wget shouldn't
show these lines.

>On the other hand, curl & safari get the expected output, eg

As they obviously handle the chunked encoding correctly.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



More information about the varnish-misc mailing list