1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 18:17:44 +00:00

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
parent 21ba9c808e
commit 39409438b2
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();