sanic icon indicating copy to clipboard operation
sanic copied to clipboard

All view methods is marked as stream

Open matemax opened this issue 2 years ago • 1 comments

Describe the bug If any View http-method is marked as stream all other method will me mark also.

Code snippet

class MyView(BaseView):
   @stream
   async def post():
       return await make_stream()
   
   async def get():
       return HTTPResponse()

Expected behavior Get method must a common sanic method with standard preparation (call await self.request.receive_body())

Environment (please complete the following information):

  • Version [v22.3.2] Additional context Problem here maybe

matemax avatar May 31 '22 15:05 matemax

So, I think the problem is that this counts as a single route definition, and the stream is applied at the definition and not handler. It might be a difficult fix. Needs more investigation.

ahopkins avatar Aug 28 '22 07:08 ahopkins