From c5102af6c7ea6681fe51548a3eb448dfd74d091c Mon Sep 17 00:00:00 2001 From: Jose Quintana Date: Wed, 2 Mar 2022 03:57:58 +0100 Subject: [PATCH] refactor: remove unnecessary `OPTIONS` check --- src/handler.rs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/handler.rs b/src/handler.rs index 6d3262d..72842ba 100644 --- a/src/handler.rs +++ b/src/handler.rs @@ -1,5 +1,3 @@ -use headers::{AcceptRanges, HeaderMapExt, HeaderValue}; -use http::header::ALLOW; use hyper::{header::WWW_AUTHENTICATE, Body, Method, Request, Response, StatusCode}; use std::{future::Future, path::PathBuf, sync::Arc}; @@ -152,16 +150,6 @@ impl RequestHandler { security_headers::append_headers(&mut resp); } - // Respond with the permitted communication options - if method == Method::OPTIONS { - *resp.status_mut() = StatusCode::NO_CONTENT; - *resp.body_mut() = Body::empty(); - resp.headers_mut() - .insert(ALLOW, HeaderValue::from_static("OPTIONS, GET, HEAD")); - resp.headers_mut().typed_insert(AcceptRanges::bytes()); - return Ok(resp); - } - Ok(resp) } Err(status) => error_page::error_response( -- libgit2 1.7.2