From a2770bbcb717b5aaad2bc0335d7df8a3c13e2170 Mon Sep 17 00:00:00 2001 From: Luke Wilde Date: Tue, 22 Jul 2025 14:01:26 +0100 Subject: [PATCH] LibWeb/WebSocket: Include the User-Agent header on connection This makes the WebSockets on https://pro.kraken.com/app/trade/btc-usd happier, but the page doesn't quite work yet. --- Libraries/LibWeb/WebSockets/WebSocket.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Libraries/LibWeb/WebSockets/WebSocket.cpp b/Libraries/LibWeb/WebSockets/WebSocket.cpp index a3684b194a2..fdf47e73e46 100644 --- a/Libraries/LibWeb/WebSockets/WebSocket.cpp +++ b/Libraries/LibWeb/WebSockets/WebSocket.cpp @@ -213,6 +213,8 @@ ErrorOr WebSocket::establish_web_socket_connection(URL::URL const& url_rec additional_headers.set("Cookie", cookies.to_byte_string()); } + additional_headers.set("User-Agent", ResourceLoader::the().user_agent().to_byte_string()); + m_websocket = ResourceLoader::the().request_client().websocket_connect(url_record, origin_string, protocol_byte_strings, {}, additional_headers); m_websocket->on_open = [weak_this = make_weak_ptr()] {