aboutsummaryrefslogtreecommitdiff
path: root/RSSDP/HttpParserBase.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2019-01-16 19:10:42 +0100
committerGitHub <noreply@github.com>2019-01-16 19:10:42 +0100
commit900dc851e6c810f9e1772a6fb901a5a7e2801baf (patch)
tree205bac3cd6df971ee18739e59bd4da0ffe91718b /RSSDP/HttpParserBase.cs
parent07a8e49c4b1e4a2dddbaa49ab6f1ff4f271fbf20 (diff)
parent933ef438894ed233fec46badf58dd4f26492e832 (diff)
Merge branch 'dev' into cleanup
Diffstat (limited to 'RSSDP/HttpParserBase.cs')
-rw-r--r--RSSDP/HttpParserBase.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/RSSDP/HttpParserBase.cs b/RSSDP/HttpParserBase.cs
index e841feab3..000d6db26 100644
--- a/RSSDP/HttpParserBase.cs
+++ b/RSSDP/HttpParserBase.cs
@@ -42,9 +42,9 @@ namespace Rssdp.Infrastructure
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2202:Do not dispose objects multiple times", Justification = "Honestly, it's fine. MemoryStream doesn't mind.")]
protected virtual void Parse(T message, System.Net.Http.Headers.HttpHeaders headers, string data)
{
- if (data == null) throw new ArgumentNullException("data");
- if (data.Length == 0) throw new ArgumentException("data cannot be an empty string.", "data");
- if (!LineTerminators.Any(data.Contains)) throw new ArgumentException("data is not a valid request, it does not contain any CRLF/LF terminators.", "data");
+ if (data == null) throw new ArgumentNullException(nameof(data));
+ if (data.Length == 0) throw new ArgumentException("data cannot be an empty string.", nameof(data));
+ if (!LineTerminators.Any(data.Contains)) throw new ArgumentException("data is not a valid request, it does not contain any CRLF/LF terminators.", nameof(data));
using (var retVal = new ByteArrayContent(EmptyByteArray))
{
@@ -77,10 +77,10 @@ namespace Rssdp.Infrastructure
/// <returns>A <see cref="Version"/> object containing the parsed version data.</returns>
protected Version ParseHttpVersion(string versionData)
{
- if (versionData == null) throw new ArgumentNullException("versionData");
+ if (versionData == null) throw new ArgumentNullException(nameof(versionData));
var versionSeparatorIndex = versionData.IndexOf('/');
- if (versionSeparatorIndex <= 0 || versionSeparatorIndex == versionData.Length) throw new ArgumentException("request header line is invalid. Http Version not supplied or incorrect format.", "versionData");
+ if (versionSeparatorIndex <= 0 || versionSeparatorIndex == versionData.Length) throw new ArgumentException("request header line is invalid. Http Version not supplied or incorrect format.", nameof(versionData));
return Version.Parse(versionData.Substring(versionSeparatorIndex + 1));
}