1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-27 09:42:57 +01:00
This commit is contained in:
Rob Ede 2022-07-23 02:48:28 +01:00
parent 14bcf72ec1
commit 8d260e599f
No known key found for this signature in database
GPG Key ID: 97C636207D3EF933
6 changed files with 7 additions and 2 deletions

View File

@ -27,7 +27,7 @@ impl<'a> ResourcePath for &'a str {
impl ResourcePath for bytestring::ByteString {
fn path(&self) -> &str {
&*self
self
}
}

View File

@ -319,6 +319,7 @@ mod tests {
.to_request();
let res = test::call_service(&app, req).await;
assert_eq!(res.status(), StatusCode::OK);
#[allow(clippy::mutable_key_type)]
let vary_headers = res.headers().get_all(header::VARY).collect::<HashSet<_>>();
assert!(vary_headers.contains(&HeaderValue::from_static("x-test")));
assert!(vary_headers.contains(&HeaderValue::from_static("accept-encoding")));

View File

@ -253,7 +253,7 @@ impl HttpRequest {
#[inline]
pub fn connection_info(&self) -> Ref<'_, ConnectionInfo> {
if !self.extensions().contains::<ConnectionInfo>() {
let info = ConnectionInfo::new(self.head(), &*self.app_config());
let info = ConnectionInfo::new(self.head(), self.app_config());
self.extensions_mut().insert(info);
}

View File

@ -401,6 +401,8 @@ where
.into_factory()
.map_err(|err| err.into().error_response());
// false positive lint (?)
#[allow(clippy::significant_drop_in_scrutinee)]
let acceptor_config = match c.tls_handshake_timeout {
Some(dur) => TlsAcceptorConfig::default().handshake_timeout(dur),
None => TlsAcceptorConfig::default(),

View File

@ -134,6 +134,7 @@ where
/// ```
#[derive(Clone, Default)]
pub struct PathConfig {
#[allow(clippy::type_complexity)]
err_handler: Option<Arc<dyn Fn(PathError, &HttpRequest) -> Error + Send + Sync>>,
}

View File

@ -169,6 +169,7 @@ impl<T: DeserializeOwned> FromRequest for Query<T> {
/// ```
#[derive(Clone, Default)]
pub struct QueryConfig {
#[allow(clippy::type_complexity)]
err_handler: Option<Arc<dyn Fn(QueryPayloadError, &HttpRequest) -> Error + Send + Sync>>,
}