summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs4
-rw-r--r--src/main.rs17
2 files changed, 11 insertions, 10 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 9145fb1..c420e96 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -146,7 +146,9 @@ pub async fn filter_request(
| (&Method::OPTIONS, [index, "_mapping"]) => {
filter_read_request(index, path_chunks[1], &params, config)?
}
- _ => Err(ProxyError::NotSupported("unknown elasticsearch API endpoint".to_string()))?,
+ _ => Err(ProxyError::NotSupported(
+ "unknown elasticsearch API endpoint".to_string(),
+ ))?,
};
let upstream_query = serde_urlencoded::to_string(params).expect("re-encoding URL parameters");
diff --git a/src/main.rs b/src/main.rs
index 1855ab5..d62bb36 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -16,20 +16,19 @@ async fn upstream_req(
config: ProxyConfig,
) -> Result<Response<Body>, hyper::Error> {
info!("request: {} {}", req.method(), req.uri());
- let upstream_resp: Result<Response<Body>, ProxyError> = match filter_request(req, &config).await {
+ let upstream_resp: Result<Response<Body>, ProxyError> = match filter_request(req, &config).await
+ {
Ok(parsed_req) => {
debug!("forwarding request upstream");
- Client::new().request(parsed_req)
- .await
- .map_err(|e| {
- warn!("upstream error: {}", e);
- ProxyError::UpstreamError(e.to_string())
- })
- },
+ Client::new().request(parsed_req).await.map_err(|e| {
+ warn!("upstream error: {}", e);
+ ProxyError::UpstreamError(e.to_string())
+ })
+ }
Err(e) => {
warn!("blocked: {:?}", e);
Err(e)
- },
+ }
};
let mut resp = match upstream_resp {
Ok(resp) => resp,