aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-03-16 12:47:14 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-03-16 12:47:14 -0400
commitf988539e13e9f0a4bc206d2b6803520a35b7228e (patch)
treecdcaed37811773497678813a56453e6cc5de083f /MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs
parent3c92842bce81e138f55876f53499642f79f399ce (diff)
update session listener
Diffstat (limited to 'MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs b/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs
index dda4c2b90..b8cab0c19 100644
--- a/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs
+++ b/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs
@@ -85,7 +85,8 @@ namespace MediaBrowser.Server.Implementations.Session
async void _httpServer_WebSocketConnecting(object sender, WebSocketConnectingEventArgs e)
{
- if (e.QueryString.AllKeys.Contains("api_key", StringComparer.OrdinalIgnoreCase))
+ var token = e.QueryString["api_key"];
+ if (!string.IsNullOrWhiteSpace(token))
{
var session = await GetSession(e.QueryString, e.Endpoint).ConfigureAwait(false);
@@ -98,6 +99,11 @@ namespace MediaBrowser.Server.Implementations.Session
private Task<SessionInfo> GetSession(NameValueCollection queryString, string remoteEndpoint)
{
+ if (queryString == null)
+ {
+ throw new ArgumentNullException("queryString");
+ }
+
var token = queryString["api_key"];
if (string.IsNullOrWhiteSpace(token))
{