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

Impl IntoResponse for File #63

Open
zacharygolba opened this issue Dec 9, 2024 · 0 comments
Open

Impl IntoResponse for File #63

zacharygolba opened this issue Dec 9, 2024 · 0 comments

Comments

@zacharygolba
Copy link
Owner

Refactoring the static-server middleware can come in 2 phases. First, we can implement IntoResponse for File in via proper. In the future we can decide whether or not to implement an official static server middleware. I like the idea of seeing what the community comes up with.

The criteria for closing this issue is as follows. Create an impl IntoResponse for std::fs::File and tokio::fs::File (both requiring a feature flag). The implementation should respond with the entire contents of the File buffered in memory and should error if the File is larger than some constant limit imposed at the callsite with builder pattern similar to actix.

A streaming file implementation can be added either as a part of one builder struct or two discrete types. It can also be done in a separate pull request with a separate issue. I'm open to bikeshedding about the best approach here if anyone wants to chime in.

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

No branches or pull requests

1 participant