The Free Software Media System - Server Backend & API
Using for instead of while
Tommaso Stocchi3c019d1324c6
diff --git a/Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.cs b/Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.csindex 7a83b72133..26f3b8d68f 100644--- a/Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.cs+++ b/Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.cs@@ -276,16 +276,15 @@ namespace Emby.Server.Implementations.HttpServer.Securitypublic static Dictionary<string, string> GetParts(string authtorizationHeader){var result = new Dictionary<string, string>();- var escapeChars = new[] { '"', ',' };var escaped = false;int start = 0;- int i = 0;string key = string.Empty;- while (i < authtorizationHeader.Length)+ int i;+ for (i = 0; i < authtorizationHeader.Length; i++){var token = authtorizationHeader[i];- if (escapeChars.Contains(token))+ if (token == '"' || token == ','){// Applying a XOR logic to evaluate whether it is opening or closing a valueescaped = (!escaped) == (token == '"');@@ -306,8 +305,6 @@ namespace Emby.Server.Implementations.HttpServer.Securitykey = authtorizationHeader[start.. i];start = i + 1;}-- i++;}// Add last value