Following the example set in Izmailoff's blog post, I was able to send remote files from Flask to the user, but when I switched to Quart, I started receiving a TypeError: 'function' object is not iterable
error.
The code is almost the exact same as on the blog, and I've tried using await
to no avail, as it errored out with object Response can't be used in 'await' expression
.
My code is as follows, with raw_url
being the direct-access URL:
req = requests.get(raw_url, stream=True)
return Response(stream_with_context(req.iter_content()), content_type=req.headers['content-type'])