Merge: nitcorn: possible fix for the bug on input with unicode
authorJean Privat <jean@pryen.org>
Fri, 23 Sep 2016 03:07:09 +0000 (23:07 -0400)
committerJean Privat <jean@pryen.org>
Fri, 23 Sep 2016 03:07:09 +0000 (23:07 -0400)
Pull-Request: #2317
Reviewed-by: Jean Privat <jean@pryen.org>

lib/nitcorn/http_request_buffer.nit

index 573d5f5..84fb8ca 100644 (file)
@@ -100,7 +100,7 @@ class HTTPConnection
 
        # We are receiving body parts.
        private fun parse_body(str: String) do
-               current_length += str.length
+               current_length += str.byte_length
                current_body.add str
                if current_length >= content_length then
                        parse_end