Fork of mbed-http

Fork of mbed-http by sandbox

Revision:
13:efe5c8b16dab
Parent:
11:96e4dcb9c0c2
Child:
14:5f9acddaa0a4
--- a/source/http_request.h	Tue Mar 28 14:47:51 2017 +0200
+++ b/source/http_request.h	Wed Mar 29 16:52:54 2017 +0100
@@ -147,6 +147,7 @@
 
         // Create a response object
         response = new HttpResponse();
+        // response->set_chunked();
         // And a response parser
         HttpResponseParser parser(response, body_callback);
 
@@ -166,6 +167,10 @@
                 return NULL;
             }
 
+            if (response->get_expected_content_length() == 0) {
+                response->set_chunked();
+            }
+
             if (response->is_message_complete()) {
                 break;
             }