http_client: remove Transfer-Encoding from resp MK-445
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 16 May 2013 08:13:50 +0000 (10:13 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 16 May 2013 08:15:27 +0000 (10:15 +0200)
The Transfer-Encoding should not be relay'ed back to frontend_net
etc.. This will cause a bad response.

src/filter_http_client.cpp

index 7703a97..74a1aa8 100644 (file)
@@ -92,6 +92,14 @@ void yf::HTTPClient::Rep::proxy(mp::Package &package)
         if (http_response)
         {
             res_gdu = o.create_HTTP_Response(package.session(), hreq, 200);
+            Z_HTTP_Header **hp = &http_response->headers;
+            while (*hp)
+            {
+                if (!yaz_matchstr((*hp)->name, "Transfer-Encoding"))
+                    *hp = (*hp)->next;
+                else
+                    hp = &(*hp)->next;
+            }
             res_gdu->u.HTTP_Response = http_response;
         }
         else