aboutsummaryrefslogtreecommitdiff
path: root/RSSDP/HttpRequestParser.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-11-27 14:08:55 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-11-27 14:08:55 -0500
commit808f2f3095c18c18be7a6fd957ddeda2c4c97693 (patch)
tree075924563ebee092d3359b219e9e10841b9c3a4e /RSSDP/HttpRequestParser.cs
parent58a7829ecd773dbc3c875d3f0d4438b847fd54b5 (diff)
update rssdp
Diffstat (limited to 'RSSDP/HttpRequestParser.cs')
-rw-r--r--RSSDP/HttpRequestParser.cs9
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).