about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--ext/kcar/kcar.rl2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/kcar/kcar.rl b/ext/kcar/kcar.rl
index c85eb3c..336af55 100644
--- a/ext/kcar/kcar.rl
+++ b/ext/kcar/kcar.rl
@@ -199,6 +199,8 @@ static void finalize_header(struct http_parser *hp, VALUE hdr)
         rb_raise(eParserError, "Content-Length set with chunked encoding");
       else
         hp->len.chunk = 0;
+    } else if (hp->len.content < 0) {
+        hp->len.content = 0;
     }
 
     if (!hp->has_query)