LibWeb: Send Origin on WebSocket connection

Some services using WebSockets require that the request contains the
Origin header, otherwise these services will return a 403 Forbidden
response. WebSocketServer already supports sending the Origin header,
however LibWeb did not send the origin with the IPC request.
This commit is contained in:
Michiel Visser 2022-02-17 11:19:19 +01:00 committed by Andreas Kling
commit 39409438b2
Notes: sideshowbarker 2024-07-17 18:01:06 +09:00
2 changed files with 5 additions and 4 deletions

View file

@ -35,7 +35,7 @@ class WebSocketClientManager : public Core::Object {
public:
static WebSocketClientManager& the();
RefPtr<Protocol::WebSocket> connect(const AK::URL&);
RefPtr<Protocol::WebSocket> connect(const AK::URL&, String const& origin);
private:
static ErrorOr<NonnullRefPtr<WebSocketClientManager>> try_create();