1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-05-19 16:58:14 +00: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>>,
}