diff --git a/rpxy-lib/src/message_handler/handler_main.rs b/rpxy-lib/src/message_handler/handler_main.rs index ceb5db46..a4b257a9 100644 --- a/rpxy-lib/src/message_handler/handler_main.rs +++ b/rpxy-lib/src/message_handler/handler_main.rs @@ -217,14 +217,14 @@ where }; self.globals.runtime_handle.spawn(async move { - let mut response_upgraded = TokioIo::new(onupgrade.await.map_err(|e| { - error!("Failed to upgrade response: {}", e); - RpxyError::FailedToUpgradeResponse(e.to_string()) - })?); let mut request_upgraded = TokioIo::new(request_upgraded.await.map_err(|e| { error!("Failed to upgrade request: {}", e); RpxyError::FailedToUpgradeRequest(e.to_string()) })?); + let mut response_upgraded = TokioIo::new(onupgrade.await.map_err(|e| { + error!("Failed to upgrade response: {}", e); + RpxyError::FailedToUpgradeResponse(e.to_string()) + })?); copy_bidirectional(&mut response_upgraded, &mut request_upgraded) .await .map_err(|e| {