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.
This commit is contained in:
Luke Wilde 2025-07-22 14:01:26 +01:00 committed by Luke Wilde
commit a2770bbcb7
Notes: github-actions[bot] 2025-07-23 12:52:50 +00:00

View file

@ -213,6 +213,8 @@ ErrorOr<void> WebSocket::establish_web_socket_connection(URL::URL const& url_rec
additional_headers.set("Cookie", cookies.to_byte_string()); 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 = ResourceLoader::the().request_client().websocket_connect(url_record, origin_string, protocol_byte_strings, {}, additional_headers);
m_websocket->on_open = [weak_this = make_weak_ptr<WebSocket>()] { m_websocket->on_open = [weak_this = make_weak_ptr<WebSocket>()] {