feat: allow http head requests
This commit is contained in:
parent
39e72a8eb6
commit
7d332b7c31
25
src/main.rs
25
src/main.rs
|
@ -80,24 +80,27 @@ async fn main() -> std::io::Result<()> {
|
|||
.app_data(db.clone())
|
||||
.app_data(expiry_watch_sender.clone())
|
||||
.app_data(config.clone())
|
||||
.service(web::resource("/").route(web::get().to(upload::index)))
|
||||
.service(
|
||||
web::resource("/")
|
||||
.route(web::get().to(upload::index))
|
||||
.route(web::head().to(upload::index)),
|
||||
)
|
||||
.service(web::resource("/upload").route(web::post().to(upload::upload)))
|
||||
.service(
|
||||
web::resource(["/upload/{id}", "/upload/{id}/{name}"])
|
||||
.route(web::get().to(upload::uploaded)),
|
||||
.route(web::get().to(upload::uploaded))
|
||||
.route(web::head().to(upload::uploaded)),
|
||||
)
|
||||
.service(Files::new("/static", "static").disable_content_disposition())
|
||||
.default_service(web::route().to(not_found))
|
||||
.service(
|
||||
web::resource([
|
||||
"/{id:[a-z0-9]{5}}",
|
||||
"/{id:[a-z0-9]{5}}/{name}",
|
||||
])
|
||||
.wrap(Condition::new(
|
||||
config.enable_rate_limit,
|
||||
Governor::new(&governor_conf),
|
||||
))
|
||||
.route(web::get().to(download::download)),
|
||||
web::resource(["/{id:[a-z0-9]{5}}", "/{id:[a-z0-9]{5}}/{name}"])
|
||||
.wrap(Condition::new(
|
||||
config.enable_rate_limit,
|
||||
Governor::new(&governor_conf),
|
||||
))
|
||||
.route(web::get().to(download::download))
|
||||
.route(web::head().to(download::download)),
|
||||
)
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue