diff options
| author | Markus Pettersson <markus.pettersson@mullvad.net> | 2025-07-15 13:09:41 +0200 |
|---|---|---|
| committer | Markus Pettersson <markus.pettersson@mullvad.net> | 2025-07-15 14:56:58 +0200 |
| commit | ebe328d1724a63c6d93df2155195ba7c5558fde2 (patch) | |
| tree | 78a6f14dc59eedea90f7065989ccf04164378dc5 /mullvad-masque-proxy/src/server | |
| parent | de3b988970d47625cffb4497d4d425fa3a6d0a4b (diff) | |
| download | mullvadvpn-ebe328d1724a63c6d93df2155195ba7c5558fde2.tar.xz mullvadvpn-ebe328d1724a63c6d93df2155195ba7c5558fde2.zip | |
Fix `collapsible_if` clippy lint
Diffstat (limited to 'mullvad-masque-proxy/src/server')
| -rw-r--r-- | mullvad-masque-proxy/src/server/mod.rs | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/mullvad-masque-proxy/src/server/mod.rs b/mullvad-masque-proxy/src/server/mod.rs index 205b7b912f..f8f224d485 100644 --- a/mullvad-masque-proxy/src/server/mod.rs +++ b/mullvad-masque-proxy/src/server/mod.rs @@ -186,26 +186,26 @@ impl Server { } } - if let Some(hostname) = &server_params.hostname { - if &proxy_uri.hostname != hostname { - let valid_uri = ProxyUri { - hostname: hostname.to_string(), - ..proxy_uri - }; + if let Some(hostname) = &server_params.hostname + && &proxy_uri.hostname != hostname + { + let valid_uri = ProxyUri { + hostname: hostname.to_string(), + ..proxy_uri + }; - respond_with_redirect(stream, valid_uri).await; + respond_with_redirect(stream, valid_uri).await; - // NOTE: Recursing like this makes us vulnerable to DoS if the client keeps - // sending the wrong hostname. This is fine since this is just an example server. - Box::pin(Self::accept_proxy_request( - quic_conn, - http_conn, - server_params, - )) - .await; + // NOTE: Recursing like this makes us vulnerable to DoS if the client keeps + // sending the wrong hostname. This is fine since this is just an example server. + Box::pin(Self::accept_proxy_request( + quic_conn, + http_conn, + server_params, + )) + .await; - return; - } + return; } if !server_params |
