mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-30 00:21:02 +03:00
copilot review: normalize HTTP method before direct request dispatch
Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
@@ -1482,7 +1482,8 @@ async fn get_http_response_async(
|
|||||||
tls_type.unwrap_or(TlsType::Rustls),
|
tls_type.unwrap_or(TlsType::Rustls),
|
||||||
danger_accept_invalid_cert.unwrap_or(false),
|
danger_accept_invalid_cert.unwrap_or(false),
|
||||||
);
|
);
|
||||||
let mut http_client = match method {
|
let normalized_method = method.to_ascii_lowercase();
|
||||||
|
let mut http_client = match normalized_method.as_str() {
|
||||||
"get" => http_client.get(url),
|
"get" => http_client.get(url),
|
||||||
"post" => http_client.post(url),
|
"post" => http_client.post(url),
|
||||||
"put" => http_client.put(url),
|
"put" => http_client.put(url),
|
||||||
|
|||||||
Reference in New Issue
Block a user