Răsfoiți Sursa

update components

Luke Pulverenti 8 ani în urmă
părinte
comite
6d344fabb9

+ 18 - 11
Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.cs

@@ -49,6 +49,7 @@ namespace Emby.Server.Implementations.HttpServer.Security
             string device = null;
             string device = null;
             string client = null;
             string client = null;
             string version = null;
             string version = null;
+            string token = null;
 
 
             if (auth != null)
             if (auth != null)
             {
             {
@@ -56,9 +57,13 @@ namespace Emby.Server.Implementations.HttpServer.Security
                 auth.TryGetValue("Device", out device);
                 auth.TryGetValue("Device", out device);
                 auth.TryGetValue("Client", out client);
                 auth.TryGetValue("Client", out client);
                 auth.TryGetValue("Version", out version);
                 auth.TryGetValue("Version", out version);
+                auth.TryGetValue("Token", out token);
             }
             }
 
 
-            var token = httpReq.Headers["X-Emby-Token"];
+            if (string.IsNullOrWhiteSpace(token))
+            {
+                token = httpReq.Headers["X-Emby-Token"];
+            }
 
 
             if (string.IsNullOrWhiteSpace(token))
             if (string.IsNullOrWhiteSpace(token))
             {
             {
@@ -156,8 +161,10 @@ namespace Emby.Server.Implementations.HttpServer.Security
             // There should be at least to parts
             // There should be at least to parts
             if (parts.Length != 2) return null;
             if (parts.Length != 2) return null;
 
 
+            var acceptedNames = new[] { "MediaBrowser", "Emby"};
+
             // It has to be a digest request
             // It has to be a digest request
-            if (!string.Equals(parts[0], "MediaBrowser", StringComparison.OrdinalIgnoreCase))
+            if (!acceptedNames.Contains(parts[0] ?? string.Empty, StringComparer.OrdinalIgnoreCase))
             {
             {
                 return null;
                 return null;
             }
             }
@@ -174,7 +181,7 @@ namespace Emby.Server.Implementations.HttpServer.Security
 
 
                 if (param.Length == 2)
                 if (param.Length == 2)
                 {
                 {
-					var value = NormalizeValue (param[1].Trim(new[] { '"' }));
+                    var value = NormalizeValue(param[1].Trim(new[] { '"' }));
                     result.Add(param[0], value);
                     result.Add(param[0], value);
                 }
                 }
             }
             }
@@ -182,14 +189,14 @@ namespace Emby.Server.Implementations.HttpServer.Security
             return result;
             return result;
         }
         }
 
 
-		private string NormalizeValue(string value)
-		{
-			if (string.IsNullOrWhiteSpace (value)) 
-			{
-				return value;
-			}
+        private string NormalizeValue(string value)
+        {
+            if (string.IsNullOrWhiteSpace(value))
+            {
+                return value;
+            }
 
 
-			return System.Net.WebUtility.HtmlEncode(value);
-		}
+            return System.Net.WebUtility.HtmlEncode(value);
+        }
     }
     }
 }
 }

+ 1 - 1
Nuget/MediaBrowser.Common.nuspec

@@ -2,7 +2,7 @@
 <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
 <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
     <metadata>
     <metadata>
         <id>MediaBrowser.Common</id>
         <id>MediaBrowser.Common</id>
-        <version>3.0.693</version>
+        <version>3.0.694</version>
         <title>Emby.Common</title>
         <title>Emby.Common</title>
         <authors>Emby Team</authors>
         <authors>Emby Team</authors>
         <owners>ebr,Luke,scottisafool</owners>
         <owners>ebr,Luke,scottisafool</owners>

+ 2 - 2
Nuget/MediaBrowser.Server.Core.nuspec

@@ -2,7 +2,7 @@
 <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
 <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
     <metadata>
     <metadata>
         <id>MediaBrowser.Server.Core</id>
         <id>MediaBrowser.Server.Core</id>
-        <version>3.0.693</version>
+        <version>3.0.694</version>
         <title>Emby.Server.Core</title>
         <title>Emby.Server.Core</title>
         <authors>Emby Team</authors>
         <authors>Emby Team</authors>
         <owners>ebr,Luke,scottisafool</owners>
         <owners>ebr,Luke,scottisafool</owners>
@@ -12,7 +12,7 @@
         <description>Contains core components required to build plugins for Emby Server.</description>
         <description>Contains core components required to build plugins for Emby Server.</description>
         <copyright>Copyright © Emby 2013</copyright>
         <copyright>Copyright © Emby 2013</copyright>
         <dependencies>
         <dependencies>
-            <dependency id="MediaBrowser.Common" version="3.0.693" />
+            <dependency id="MediaBrowser.Common" version="3.0.694" />
         </dependencies>
         </dependencies>
     </metadata>
     </metadata>
     <files>
     <files>