Index: third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp |
diff --git a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp |
index ca91d4b9367fc35e544d558094b396e5dba52f12..8d1bef3f859fef9618e34708ef1ed143ceda51f4 100644 |
--- a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp |
+++ b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp |
@@ -182,7 +182,8 @@ bool DocumentWebSocketChannel::connect(const KURL& url, const String& protocol) |
if (document()->frame()) |
document()->frame()->loader().client()->dispatchWillOpenWebSocket(m_handle.get()); |
- m_handle->connect(url, webProtocols, WebSecurityOrigin(getExecutionContext()->getSecurityOrigin()), this); |
+ |
+ m_handle->connect(url, webProtocols, WebSecurityOrigin(getExecutionContext()->getSecurityOrigin()), additionalHeaders(), this); |
flowControlIfNecessary(); |
TRACE_EVENT_INSTANT1("devtools.timeline", "WebSocketCreate", TRACE_EVENT_SCOPE_THREAD, "data", InspectorWebSocketCreateEvent::data(document(), m_identifier, url, protocol)); |
@@ -576,6 +577,15 @@ void DocumentWebSocketChannel::didFailLoadingBlob(FileError::ErrorCode errorCode |
// |this| can be deleted here. |
} |
+const WebString DocumentWebSocketChannel::additionalHeaders() |
+{ |
+ StringBuilder headers; |
+ headers.append(HTTPNames::User_Agent); |
+ headers.append(':'); |
+ headers.append(document()->userAgent()); |
+ return headers.toString(); |
+} |
+ |
DEFINE_TRACE(DocumentWebSocketChannel) |
{ |
visitor->trace(m_blobLoader); |