-
Notifications
You must be signed in to change notification settings - Fork 166
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
Don't return file content for HEAD requests in ServeFile, ServeDir #113
Comments
I wonder whether it makes sense to even support all methods by default. Just ignoring |
Fixing this will unfortunately be a breaking change since |
I agree. Method handling could be improved for |
Oh I see, there's only one more service currently which is the redirect one (which probably should work the same regardless of HTTP method). |
#156 Have the same required breaking change since it needs to inspect the |
As discussed in tokio-rs/axum#84,
ServeFile
andServeDir
could be improved re. handling of HEAD requests. Responses to HEAD requests should be identical to the corresponding GETs response, but without a body.The implementation should probably use
fs::metadata
instead of opening the file to fulfill HEAD requests more efficiently.The text was updated successfully, but these errors were encountered: