Skip to content
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

DM-38425: Stream monkey logs instead of using FileResponse #251

Merged
merged 1 commit into from
May 11, 2023

Conversation

rra
Copy link
Member

@rra rra commented May 11, 2023

Starlette FileResponse no longer works to return monkey logs because it now commits to a Content-Length when starting to stream the file but doesn't stop sending data at that cutoff, so it sends more data than Content-Length since the log file is changing, and that in turn causes an HTTP protocol failure that prevents Chrome (at least) from successfully downloading the file.

Instead, simulate that with StreamResponse while setting a Content-Disposition header.

Starlette FileResponse no longer works to return monkey logs
because it now commits to a Content-Length when starting to stream
the file but doesn't stop sending data at that cutoff, so it sends
more data than Content-Length since the log file is changing, and
that in turn causes an HTTP protocol failure that prevents Chrome
(at least) from successfully downloading the file.

Instead, simulate that with StreamResponse while setting a
Content-Disposition header.
@rra rra merged commit db8aadb into main May 11, 2023
@rra rra deleted the tickets/DM-38425 branch May 11, 2023 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant