]> git.proxmox.com Git - proxmox-backup.git/commitdiff
server/rest.rs: simplify proxy code
authorDietmar Maurer <dietmar@proxmox.com>
Mon, 28 Jan 2019 17:22:16 +0000 (18:22 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 28 Jan 2019 17:22:16 +0000 (18:22 +0100)
Only pass neccessary parameters.

src/server/rest.rs

index e1d1895413d53d59ce32caa753d2c6dbfe09d2b6..6df857eb99ae63ca8e2343a4c468ab93677599ee 100644 (file)
@@ -158,13 +158,9 @@ fn get_request_parameters_async(
     Box::new(resp)
 }
 
-fn proxy_sync_api_request(
-    rpcenv: RestEnvironment,
-    info: &'static ApiMethod,
-    formatter: &'static OutputFormatter,
+fn proxy_protected_request(
     mut parts: Parts,
     req_body: Body,
-    uri_param: HashMap<String, String>,
 ) -> BoxFut
 {
 
@@ -448,7 +444,7 @@ pub fn handle_request(api: Arc<ApiConfig>, req: Request<Body>) -> BoxFut {
                 MethodDefinition::None => {}
                 MethodDefinition::Simple(api_method) => {
                     if api_method.protected && env_type == RpcEnvironmentType::PUBLIC {
-                        return proxy_sync_api_request(rpcenv, api_method, formatter, parts, body, uri_param);
+                        return proxy_protected_request(parts, body);
                     } else {
                         return handle_sync_api_request(rpcenv, api_method, formatter, parts, body, uri_param);
                     }