summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2020-10-18 13:18:31 -0700
committerBryan Newbold <bnewbold@archive.org>2020-10-18 13:18:31 -0700
commit5095c3030048b3dc469a363b0c8cad9278baab75 (patch)
treed7b9f546cb23b5a8deaffdb1f73429734b3ebbcc /src/main.rs
parentf3580e317235398e70fac5439f931c35c7bbcea6 (diff)
downloades-public-proxy-5095c3030048b3dc469a363b0c8cad9278baab75.tar.gz
es-public-proxy-5095c3030048b3dc469a363b0c8cad9278baab75.zip
rustfmt
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs17
1 files changed, 8 insertions, 9 deletions
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,