From c8f3f9b1afad1ccbaa0b8b47d0fadaefc3a40255 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Mon, 28 Jan 2019 18:22:16 +0100 Subject: [PATCH] server/rest.rs: simplify proxy code Only pass neccessary parameters. --- src/server/rest.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/server/rest.rs b/src/server/rest.rs index e1d18954..6df857eb 100644 --- a/src/server/rest.rs +++ b/src/server/rest.rs @@ -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, ) -> BoxFut { @@ -448,7 +444,7 @@ pub fn handle_request(api: Arc, req: Request) -> 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); }