Skip to content

Commit

Permalink
Make several paths POST-able
Browse files Browse the repository at this point in the history
Some paths accpet only PUT method. To be compatible with Hashicorp
Vault, this commit makes them are also POST-able.
  • Loading branch information
InfoHunter committed Apr 30, 2024
1 parent a608ce9 commit d18158a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/http/sys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,20 @@ pub fn init_sys_service(cfg: &mut web::ServiceConfig) {
.service(
web::resource("/init")
.route(web::get().to(sys_init_get_request_handler))
.route(web::post().to(sys_init_put_request_handler))
.route(web::put().to(sys_init_put_request_handler)),
)
.service(web::resource("/seal-status").route(web::get().to(sys_seal_status_request_handler)))
.service(web::resource("/seal").route(web::put().to(sys_seal_request_handler)))
.service(web::resource("/unseal").route(web::put().to(sys_unseal_request_handler)))
.service(
web::resource("/seal")
.route(web::post().to(sys_seal_request_handler))
.route(web::put().to(sys_seal_request_handler)),
)
.service(
web::resource("/unseal")
.route(web::post().to(sys_unseal_request_handler))
.route(web::put().to(sys_unseal_request_handler)),
)
.service(web::resource("/mounts").route(web::get().to(sys_list_mounts_request_handler)))
.service(
web::resource("/mounts/{path:.*}")
Expand Down

0 comments on commit d18158a

Please sign in to comment.