Skip to content

Commit 94c26e6

Browse files
committed
Fix for issue sta#42, enable redirection to the new url located in the handshake response
1 parent 072ad21 commit 94c26e6

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

websocket-sharp/WebSocket.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,34 @@ public NetworkCredential Credentials {
289289
}
290290
}
291291

292+
/// <summary>
293+
/// Gets or sets a value indicating whether the <see cref="WebSocket"/> redirects to
294+
/// the new URL located in the handshake response.
295+
/// </summary>
296+
/// <value>
297+
/// <c>true</c> if the <see cref="WebSocket"/> redirects to the new URL;
298+
/// otherwise, <c>false</c>. The default value is <c>false</c>.
299+
/// </value>
300+
public bool EnableRedirection {
301+
get {
302+
return _enableRedirection;
303+
}
304+
305+
set {
306+
lock (_forConn) {
307+
var msg = checkIfAvailable (false, false);
308+
if (msg != null) {
309+
_logger.Error (msg);
310+
error ("An error has occurred in setting the enable redirection.", null);
311+
312+
return;
313+
}
314+
315+
_enableRedirection = value;
316+
}
317+
}
318+
}
319+
292320
/// <summary>
293321
/// Gets the WebSocket extensions selected by the server.
294322
/// </summary>

0 commit comments

Comments
 (0)