Bug 124580 - Expose API for modifying WebSocket HTTP Handshake request
Summary: Expose API for modifying WebSocket HTTP Handshake request
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.9
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2013-11-19 07:31 PST by lfranchi@kde.org
Modified: 2013-11-19 09:47 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lfranchi@kde.org 2013-11-19 07:31:52 PST
In order to implement a private cookie jar in Cocoa WebKit, absent a built-in method, the best solution is to implement webView:willSendRequest: and webView:didReceiveResponse and handling cookies manually. This means basically replacing the built-in cookie handling in the WebView and storing/loading cookies in client code.

However, when using WebSockets, the initial HTTP upgrade/handshake request does not go through this mechanism (WebSocketHandshake::clientHandshakeMessage builds the header directly). This means that it's impossible to include the correct cookies in the WebSocket handshake request, as the HTTP request bypasses any user code completely. 

It would be great to be able to attach cookies etc to this HTTP request as with any other HTTP request, otherwise it's impossible to properly implement a sandboxed-cookie-jar app using Cocoa's WebView.

c.f. https://lists.webkit.org/pipermail/webkit-help/2013-November/003644.html
Comment 1 Alexey Proskuryakov 2013-11-19 09:47:49 PST
<rdar://problem/7450841>