From 1fee27e582e9ad9981dd54adad6d47f18a1aae4d Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Fri, 23 Jul 2010 12:45:33 -0700 Subject: fix -http-proxy implementation to work correctly with chunked encoding. Change-Id: I3d8a18bd0849c75d0133b234a8aa74069ad71baa --- proxy/proxy_http_rewriter.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'proxy') diff --git a/proxy/proxy_http_rewriter.c b/proxy/proxy_http_rewriter.c index afd929c..7645ecc 100644 --- a/proxy/proxy_http_rewriter.c +++ b/proxy/proxy_http_rewriter.c @@ -751,6 +751,12 @@ rewrite_connection_read_body( RewriteConnection* conn, int fd ) root->name, length); return DATA_ERROR; } + /* proxy_connection_receive_line() did remove the + * trailing \r\n, but we must preserve it when we + * send the chunk size to the proxy. + */ + stralloc_add_str(root->str, "\r\n"); + conn->chunk_length = length; conn->chunk_total = 0; if (length == 0) { -- cgit v1.1