app-server: fix connecting via websockets with Sec-WebSocket-Extensions: permessage-deflate (#12629)

# External (non-OpenAI) Pull Request Requirements

Before opening this Pull Request, please read the dedicated
"Contributing" markdown file or your PR may be closed:
https://github.com/openai/codex/blob/main/docs/contributing.md

If your PR conforms to our contribution guidelines, replace this text
with a detailed and high quality description of your changes.

Include a link to a bug report or enhancement request.
This commit is contained in:
Javi authored and GitHub committed 2026-02-24 02:41:03 +00:00
1 parent d580995957
commit 5a3bdcb27b
1 file changed
+4 -2
+4 -2
View File
@@ -30,8 +30,9 @@ use tokio::net::TcpListener;
use tokio::net::TcpStream; use tokio::net::TcpStream;
use tokio::sync::mpsc; use tokio::sync::mpsc;
use tokio::task::JoinHandle; use tokio::task::JoinHandle;
use tokio_tungstenite::accept_async; use tokio_tungstenite::accept_async_with_config;
use tokio_tungstenite::tungstenite::Message as WebSocketMessage; use tokio_tungstenite::tungstenite::Message as WebSocketMessage;
use tokio_tungstenite::tungstenite::protocol::WebSocketConfig;
use tokio_util::sync::CancellationToken; use tokio_util::sync::CancellationToken;
use tracing::debug; use tracing::debug;
use tracing::error; use tracing::error;
@@ -307,7 +308,8 @@ async fn run_websocket_connection(
stream: TcpStream, stream: TcpStream,
transport_event_tx: mpsc::Sender<TransportEvent>, transport_event_tx: mpsc::Sender<TransportEvent>,
) { ) {
let websocket_stream = match accept_async(stream).await { let websocket_stream =
match accept_async_with_config(stream, Some(WebSocketConfig::default())).await {
Ok(stream) => stream, Ok(stream) => stream,
Err(err) => { Err(err) => {
warn!("failed to complete websocket handshake: {err}"); warn!("failed to complete websocket handshake: {err}");