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

Content length is 0 by default in aiohttp.web.Response #1940

Closed
julien-duponchelle opened this issue Jun 1, 2017 · 4 comments
Closed

Content length is 0 by default in aiohttp.web.Response #1940

julien-duponchelle opened this issue Jun 1, 2017 · 4 comments
Labels

Comments

@julien-duponchelle
Copy link
Contributor

Long story short

If you create an empty web response you will have a content length of 0 instead of None.

Expected behaviour

Content length should be None.

Actual behaviour

Content length is 0

Steps to reproduce

import aiohttp.web
r = aiohttp.web.Response()
r.content_length
>>> 0

Your environment

aiohttp 2.0.7 on macos

@julien-duponchelle
Copy link
Contributor Author

I'm not sure of me. But it seem sometimes this can create trouble with chunked encoding. That's why previously I opened this PR:
#1933

@fafhrd91
Copy link
Member

fafhrd91 commented Jun 1, 2017

this is intended behavior, because you supply response body. by default it is empty.

@julien-duponchelle
Copy link
Contributor Author

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