-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Feature request: "CompressedStaticFileResult" #40
Comments
I would be more than happy to look at any pull request you send my way, but I can't promise if I will accept it or not, it all depends on the quality. I'm not 100% sure but I think you would need to have some sort of service for this as you would have a hard time accessing configuration of |
Just a idea, haven't tried but what happens if you redirect instead? It might cause a extra roundtrip but should just work? |
Ideally for my use case I'd like to do it within the request so that the user will see the URL of the page causing the error in their address bar, instead of some generic path like I'll try drafting a PR when I can, but I work full time as a software dev so working on personal/OSS projects can often feel like working through the weekend. |
I totally understand both your work time and not wanting a redirect, no rush from me if you manage to get time it's fine, if not it's also fine! |
It would be fantastic to be able to call something like
return CompressedStaticFileResult("some/file.html");
from a webapi controller method orreturn Results.CompressedStaticFile("some/file.html");
from a minimal API endpoint to leverage the conditional request and compressed file serving logic in custom endpoints. This would allow things like serving a 401/403 page with the appropriate status code.I might be able to have a crack at this myself, I think it would look very similar to the
CompressedStaticFileMiddleware
class, except it would implementIActionResult
and defer toPhysicalFileResult
instead ofStaticFileMiddleware
. Would you consider accepting a PR?The text was updated successfully, but these errors were encountered: