I was doing some quick prototyping using Daphne and I needed to serve a file so I created a controller like this:
class Assets(Controller):
"""Hack to allow files to be specified in a browser that doesn't allow them"""
def GET(self, basename):
fp = Filepath("whatever/path", basename)
return fp.open()
This resulted in an infinite loop:
...
<DATETIME>,<PID> DEBUG HTTP response chunk for ['<IP-ADDRESS>', 55030]
<DATETIME>,<PID> DEBUG HTTP response chunk for ['<IP-ADDRESS>', 55030]
...
I'm not sure why, I switched fp.open() to fp.read_bytes() to fix it right now, but sometime in the future I should actually debug the problem.
I was doing some quick prototyping using Daphne and I needed to serve a file so I created a controller like this:
This resulted in an infinite loop:
I'm not sure why, I switched
fp.open()
tofp.read_bytes()
to fix it right now, but sometime in the future I should actually debug the problem.