-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chunked request #2
Comments
Can you send me the full source code of a test that fails? |
import httptools
import unittest
from unittest import mock
CHUNKED_REQUEST1_3 = b'''POST /test.php?a=b+c HTTP/1.2
User-Agent: Fooo
Host: bar
Transfer-Encoding: chunked
b\r\n+\xce\xcfM\xb5MI,I\x04\x00\r\n0\r\n\r\n'''
class TestRequestParser(unittest.TestCase):
def test_parser_request_chunked_3(self):
m = mock.Mock()
p = httptools.HttpRequestParser(m)
p.feed_data(CHUNKED_REQUEST1_3)
self.assertEqual(p.get_method(), b'POST')
m.on_url.assert_called_once_with(b'/test.php?a=b+c')
self.assertEqual(p.get_http_version(), '1.2')
m.on_header.assert_called_with(b'Transfer-Encoding', b'chunked')
m.on_chunk_header.assert_called_with()
m.on_chunk_complete.assert_called_with()
self.assertFalse(m.on_message_complete.called) |
Hm. I'm still not sure what's going on here. It looks like this request is invalid: the length of first chunk is |
Got it, I got an extra char in my |
Yep, it's a bug in |
Yes, I noticed that.
|
Nope. Bug in my code, which is a good thing :) Will commit a fix soon. |
Should be fixed in v0.0.6. |
The bug was in a |
Anyways, I've updated the code to use buffer protocol -- it's much more efficient. |
i am working on
httptools
integration withaiohttp
, some tests are failing with chunking and compression. if i modify httptools tests, it does not pass as well.The text was updated successfully, but these errors were encountered: