From 94c26e6107955544ea36c219bb7fc649f9e10bb9 Mon Sep 17 00:00:00 2001 From: sta Date: Tue, 16 Dec 2014 14:22:31 +0900 Subject: [PATCH] Fix for issue #42, enable redirection to the new url located in the handshake response --- websocket-sharp/WebSocket.cs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/websocket-sharp/WebSocket.cs b/websocket-sharp/WebSocket.cs index 8f10681e..6f47c93f 100644 --- a/websocket-sharp/WebSocket.cs +++ b/websocket-sharp/WebSocket.cs @@ -289,6 +289,34 @@ namespace WebSocketSharp } } + /// + /// Gets or sets a value indicating whether the redirects to + /// the new URL located in the handshake response. + /// + /// + /// true if the redirects to the new URL; + /// otherwise, false. The default value is false. + /// + public bool EnableRedirection { + get { + return _enableRedirection; + } + + set { + lock (_forConn) { + var msg = checkIfAvailable (false, false); + if (msg != null) { + _logger.Error (msg); + error ("An error has occurred in setting the enable redirection.", null); + + return; + } + + _enableRedirection = value; + } + } + } + /// /// Gets the WebSocket extensions selected by the server. ///