add Expect: 100-continue handling for #267#268
add Expect: 100-continue handling for #267#268tumb1er wants to merge 10 commits intoaio-libs:masterfrom
Conversation
Conflicts: aiohttp/protocol.py
|
Could you please rebase your branch to exclude merge commits and squash |
|
i agree "continue" should be default behavior, but there are several issues:
|
|
@kxepal I'd rather create a new pull request.
I just don't see how developer may want to change "100-continue" behavior and have unsolvable problems with it at same time. All in all, this PR:
It might be better to place all these into a separate base middleware, somethink like this: class ExpectContinueMiddlewareBase(object):
def factory(cls):
pass
def check_expectation(self, request):
""" if expectation is not met, returns final Response for it.
Returns none if all is ok. """
raise NotImplementedError() |
|
I don't like this implementation, it is too specific. What if we add Request.continue() or it could be route object responsibility. |
|
Making route responsible for continue is cleanest solution, but I don't like it right now. @asvetlov thoughts? |
|
close #287 |
request.post(), it actually agrees with "100-continue" expectation, so server must send "HTTP/1.1 100 Continue"Responsewithout reading whole request body (it may read, but don't need this)So,
request.post()is a place where 100-Continue answer could be safely sent to HTTP/1.1 clients.see #267 for more defails