Skip to content
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

Problem with trailer header #1876

Closed
yurifedoseev opened this issue May 9, 2017 · 5 comments
Closed

Problem with trailer header #1876

yurifedoseev opened this issue May 9, 2017 · 5 comments
Labels

Comments

@yurifedoseev
Copy link

Long story short

I described an issues in #1619 Later I update aiohttp for new version however the problem is still here.

Http response (body and trailers part):
"{ "doc": "some data"}\nX-Custom-Header1=0\r\nX-Custom-Header2=custom2\r\nX-Custom-Header3={}\r\n\r\n

Expected behaviour

aiohttp loads json body and skips trailers. Parsing of the next response should not read any trailers from previous response.

Actual behaviour

aiohttp loads json and do not read any trailer data from reader. Debugging shows that response reader buffer contains this trailer data.
When I use the same session the next response parsing will be started from the trailers. Therefore it leads to parsing exception.

Steps to reproduce

  1. Use the same session for requests
  2. Get response from server with trailer headers (as shown above)

Your environment

macOS Sierra, aiohttp 2.0.7

@fafhrd91
Copy link
Member

fafhrd91 commented May 9, 2017

could you write test case?

@yurifedoseev
Copy link
Author

Sure, in which format it should be?

@fafhrd91
Copy link
Member

fafhrd91 commented May 9, 2017

Doesn't matter, probably in test_client_protocol, I think it would be simplest

@yurifedoseev
Copy link
Author

I've found out that the problem was on my side while writing the test case. Your fix works as expected. Thanks!

@lock
Copy link

lock bot commented Oct 28, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants