Skip to content

New IOResponse class for serving a response using any IO object #10465

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

Draft
wants to merge 21 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/10465.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added ``IOResponse`` class to serve a response from any IO object. It is similar to FileResponse, but can be used with, for example, already opened files or BytesIO. -- by :user:`Derkades`.
3 changes: 2 additions & 1 deletion aiohttp/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
HTTPVersionNotSupported,
NotAppKeyWarning,
)
from .web_fileresponse import FileResponse
from .web_fileresponse import FileResponse, IOResponse
from .web_log import AccessLogger
from .web_middlewares import middleware, normalize_path_middleware
from .web_protocol import PayloadAccessError, RequestHandler, RequestPayloadError
Expand Down Expand Up @@ -204,6 +204,7 @@
"HTTPVersionNotSupported",
# web_fileresponse
"FileResponse",
"IOResponse",
# web_middlewares
"middleware",
"normalize_path_middleware",
Expand Down
Loading
Loading