diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-11-27 15:18:00 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-11-27 15:18:00 -0500 |
| commit | 9e452423e5f3a3811338bdad60c406baf8f3de26 (patch) | |
| tree | d3075523535d00c4e4fb579dbf8863d742a21a40 /RSSDP/HttpResponseParser.cs | |
| parent | acc17634a4cf5b8bff4fec6e7334f814fad78eb0 (diff) | |
| parent | 26edcfefbb031a98f2d6f64b692bba07587614b7 (diff) | |
Merge pull request #3045 from MediaBrowser/dev
Dev
Diffstat (limited to 'RSSDP/HttpResponseParser.cs')
| -rw-r--r-- | RSSDP/HttpResponseParser.cs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/RSSDP/HttpResponseParser.cs b/RSSDP/HttpResponseParser.cs index ba85a1657..5f297ca9a 100644 --- a/RSSDP/HttpResponseParser.cs +++ b/RSSDP/HttpResponseParser.cs @@ -75,7 +75,7 @@ namespace Rssdp.Infrastructure if (message == null) throw new ArgumentNullException("message"); var parts = data.Split(' '); - if (parts.Length < 3) throw new ArgumentException("data status line is invalid. Insufficient status parts.", "data"); + if (parts.Length < 2) throw new ArgumentException("data status line is invalid. Insufficient status parts.", "data"); message.Version = ParseHttpVersion(parts[0].Trim()); @@ -84,8 +84,12 @@ namespace Rssdp.Infrastructure throw new ArgumentException("data status line is invalid. Status code is not a valid integer.", "data"); message.StatusCode = (HttpStatusCode)statusCode; - message.ReasonPhrase = parts[2].Trim(); - } + + if (parts.Length >= 3) + { + message.ReasonPhrase = parts[2].Trim(); + } + } #endregion |
