Fixed: Parsing headers that have a trailing semi-colon (#1117)

This commit is contained in:
Mitchell Cash
2017-03-11 13:27:26 +10:00
committed by Devin Buhl
parent 149c5292f1
commit 3b3fe197ca
2 changed files with 15 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
using System.Collections.Generic;
using System.Collections.Specialized;
@@ -169,7 +169,7 @@ namespace NzbDrone.Common.Http
public static List<KeyValuePair<string, string>> ParseCookies(string cookies)
{
return cookies.Split(';')
return cookies.Split(new[] { ";" }, StringSplitOptions.RemoveEmptyEntries)
.Select(v => v.Trim().Split('='))
.Select(v => new KeyValuePair<string, string>(v[0], v[1]))
.ToList();