diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-12-05 13:37:55 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-12-05 13:37:55 -0500 |
| commit | c32d8656382a0eacb301692e0084377fc433ae9b (patch) | |
| tree | 121dd382bf71a9b5c96e00771c0ba18a7d28ab87 /RSSDP/HttpRequestParser.cs | |
| parent | e7ffdf3fbdae7d4ec76a0a4e0e37792b079c56e5 (diff) | |
| parent | b3fbdde04305a0406b5322ec6947f8a30ddc12af (diff) | |
Merge pull request #3055 from MediaBrowser/beta
Beta
Diffstat (limited to 'RSSDP/HttpRequestParser.cs')
| -rw-r--r-- | RSSDP/HttpRequestParser.cs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/RSSDP/HttpRequestParser.cs b/RSSDP/HttpRequestParser.cs index 0923f291f..bedbbe675 100644 --- a/RSSDP/HttpRequestParser.cs +++ b/RSSDP/HttpRequestParser.cs @@ -64,7 +64,7 @@ namespace Rssdp.Infrastructure if (message == null) throw new ArgumentNullException("message"); var parts = data.Split(' '); - if (parts.Length < 3) throw new ArgumentException("Status line is invalid. Insufficient status parts.", "data"); + if (parts.Length < 2) throw new ArgumentException("Status line is invalid. Insufficient status parts.", "data"); message.Method = new HttpMethod(parts[0].Trim()); Uri requestUri; @@ -73,8 +73,11 @@ namespace Rssdp.Infrastructure else System.Diagnostics.Debug.WriteLine(parts[1]); - message.Version = ParseHttpVersion(parts[2].Trim()); - } + if (parts.Length >= 3) + { + message.Version = ParseHttpVersion(parts[2].Trim()); + } + } /// <summary> /// Returns a boolean indicating whether the specified HTTP header name represents a content header (true), or a message header (false). |
