diff --git a/api/src/auth.rs b/api/src/auth.rs
index 3531ddd9a..2e2cfb336 100644
--- a/api/src/auth.rs
+++ b/api/src/auth.rs
@@ -38,13 +38,10 @@ impl Handler for BasicAuthMiddleware {
req: Request
,
mut handlers: Box>,
) -> ResponseFuture {
- if req.headers().contains_key(AUTHORIZATION) {
- if req.headers()[AUTHORIZATION] == self.api_basic_auth {
- handlers.next().unwrap().call(req, handlers)
- } else {
- // Forbidden 403
- forbidden_response()
- }
+ if req.headers().contains_key(AUTHORIZATION)
+ && req.headers()[AUTHORIZATION] == self.api_basic_auth
+ {
+ handlers.next().unwrap().call(req, handlers)
} else {
// Unauthorized 401
unauthorized_response(&self.basic_realm)
@@ -62,11 +59,3 @@ fn unauthorized_response(basic_realm: &str) -> ResponseFuture {
.unwrap();
Box::new(ok(response))
}
-
-fn forbidden_response() -> ResponseFuture {
- let response = Response::builder()
- .status(StatusCode::FORBIDDEN)
- .body(Body::empty())
- .unwrap();
- Box::new(ok(response))
-}