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

#54 Add do_use_guard option #55

Merged
merged 3 commits into from
Feb 12, 2023
Merged

#54 Add do_use_guard option #55

merged 3 commits into from
Feb 12, 2023

Conversation

joepio
Copy link
Contributor

@joepio joepio commented Feb 4, 2023

Adds the do_use_guard option, which when enabled, only calls the handler function when the files actually match. This allows people to use a static file handler on root, or other paths that also have other 'catch all' handlers that are probably slower than a hashmap check. This is useful because some static files need to be hosted on the root path, such as /robots.txt.

closes #54

@joepio joepio marked this pull request as draft February 4, 2023 12:32
@joepio
Copy link
Contributor Author

joepio commented Feb 4, 2023

The PR works locally, using it in atomic-server.

@joepio joepio marked this pull request as ready for review February 4, 2023 12:55
@joepio joepio requested a review from kilork February 8, 2023 13:19
@kilork kilork merged commit c363721 into kilork:master Feb 12, 2023
@joepio
Copy link
Contributor Author

joepio commented Feb 13, 2023

Thanks for the merge @kilork! Could you publish a new version? Since I'm currently depending on a github repo (my fork) I can't publish my project to cargo. Thanks in advance!

@kilork
Copy link
Owner

kilork commented Feb 15, 2023

@joepio Just published version 4.0.1 on crates: https://crates.io/crates/actix-web-static-files/4.0.1. Thanks for the contribution. I also checked your atomic-data project, nice job!

@joepio
Copy link
Contributor Author

joepio commented Feb 16, 2023

@joepio Just published version 4.0.1 on crates: https://crates.io/crates/actix-web-static-files/4.0.1. Thanks for the contribution. I also checked your atomic-data project, nice job!

Thanks for publishing and thanks for the compliment!

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.

Use at root - but continue to next route if none is matched
2 participants