From d18158ad7da541baacba67693ad8e915eadd1a0c Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Tue, 30 Apr 2024 16:53:48 +0800 Subject: [PATCH] Make several paths POST-able Some paths accpet only PUT method. To be compatible with Hashicorp Vault, this commit makes them are also POST-able. --- src/http/sys.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/http/sys.rs b/src/http/sys.rs index a48fef9..57dd0c5 100644 --- a/src/http/sys.rs +++ b/src/http/sys.rs @@ -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:.*}")