kilork / actix-web-static-files

actix-web static files as resources support
The Unlicense
75 stars 18 forks source link

#54 Add `do_use_guard` option #55

Closed joepio closed 1 year ago

joepio commented 1 year ago

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 commented 1 year ago

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

joepio commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

@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!