Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1e9d5a1b06504bb26ef17b263ff55dd0e47a53f2
      
https://github.com/WebKit/WebKit/commit/1e9d5a1b06504bb26ef17b263ff55dd0e47a53f2
  Author: Devin Rousso <[email protected]>
  Date:   2026-06-18 (Thu, 18 Jun 2026)

  Changed paths:
    A LayoutTests/http/tests/websocket/tests/hybi/inspector/echo-headers_wsh.py
    A 
LayoutTests/http/tests/websocket/tests/hybi/inspector/set-extra-http-headers-expected.txt
    A 
LayoutTests/http/tests/websocket/tests/hybi/inspector/set-extra-http-headers.html
    M Source/WebCore/Modules/websockets/WebSocketChannelInspector.cpp
    M Source/WebCore/Modules/websockets/WebSocketChannelInspector.h
    M Source/WebCore/Modules/websockets/WebSocketHandshake.cpp
    M Source/WebCore/Modules/websockets/WebSocketHandshake.h
    M Source/WebCore/inspector/InspectorInstrumentation.cpp
    M Source/WebCore/inspector/InspectorInstrumentation.h
    M Source/WebCore/inspector/LegacyWebSocketInspectorInstrumentation.cpp
    M Source/WebCore/inspector/LegacyWebSocketInspectorInstrumentation.h
    M Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp
    M Source/WebCore/inspector/agents/InspectorNetworkAgent.h
    M Source/WebKit/NetworkProcess/curl/WebSocketTaskCurl.cpp
    M Source/WebKit/WebProcess/Network/WebSocketChannel.cpp
    M Source/WebKitLegacy/WebCoreSupport/WebSocketChannel.cpp

  Log Message:
  -----------
  Web Inspector: `Network.setExtraHTTPHeaders` does not affect `WebSocket`
https://bugs.webkit.org/show_bug.cgi?id=317001

Reviewed by Youenn Fablet.

Test: http/tests/websocket/tests/hybi/inspector/set-extra-http-headers.html

* Source/WebCore/Modules/websockets/WebSocketHandshake.h:
* Source/WebCore/Modules/websockets/WebSocketHandshake.cpp:
(WebCore::isStandardWebSocketHandshakeRequestHeader): Added.
(WebCore::WebSocketHandshake::setClientHandshakeRequestHeaders): Added.
(WebCore::WebSocketHandshake::clientHandshakeMessage const):
(WebCore::WebSocketHandshake::clientHandshakeRequest const):
Allow the caller to set additional headers that will be included in the 
handshake message/request.

* Source/WebKit/NetworkProcess/curl/WebSocketTaskCurl.cpp:
(WebKit::WebSocketTask::didOpen):
* Source/WebKitLegacy/WebCoreSupport/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::didOpenSocketStream):
Make sure to forward any additional headers.

* Source/WebKit/WebProcess/Network/WebSocketChannel.cpp:
(WebKit::WebSocketChannel::connect):
(WebKit::WebSocketChannel::didSendHandshakeRequest):
* Source/WebCore/Modules/websockets/WebSocketChannelInspector.h:
* Source/WebCore/Modules/websockets/WebSocketChannelInspector.cpp:
(WebCore::WebSocketChannelInspector::willSendWebSocketHandshakeRequest const):
(WebCore::WebSocketChannelInspector::didSendWebSocketHandshakeRequest const): 
Added.
* Source/WebCore/inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::willSendWebSocketHandshakeRequest):
(WebCore::InspectorInstrumentation::didSendWebSocketHandshakeRequest): Added.
* Source/WebCore/inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::willSendWebSocketHandshakeRequestImpl):
(WebCore::InspectorInstrumentation::didSendWebSocketHandshakeRequestImpl): 
Added.
* Source/WebCore/inspector/LegacyWebSocketInspectorInstrumentation.h:
* Source/WebCore/inspector/LegacyWebSocketInspectorInstrumentation.cpp:
(WebCore::LegacyWebSocketInspectorInstrumentation::willSendWebSocketHandshakeRequest):
(WebCore::LegacyWebSocketInspectorInstrumentation::didSendWebSocketHandshakeRequest):
 Added.
* Source/WebCore/inspector/agents/InspectorNetworkAgent.h:
* Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::willSendWebSocketHandshakeRequest):
(WebCore::InspectorNetworkAgent::didSendWebSocketHandshakeRequest): Added.
(WebCore::InspectorNetworkAgent::enable):
Rename the existing `willSendWebSocketHandshakeRequest` to 
`didSendWebSocketHandshakeRequest` since it actually instrumented after the 
request was sent.
Add a new `willSendWebSocketHandshakeRequest` that allows Web Inspector to 
modify the request before it is sent.

* LayoutTests/http/tests/websocket/tests/hybi/inspector/echo-headers_wsh.py: 
Added.
* 
LayoutTests/http/tests/websocket/tests/hybi/inspector/set-extra-http-headers.html:
 Added.
* 
LayoutTests/http/tests/websocket/tests/hybi/inspector/set-extra-http-headers-expected.txt:
 Added.

Canonical link: https://commits.webkit.org/315465@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to