From a8c55ae8fec58b3aacd1cf311a8ac9c2dda503ff Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Thu, 9 Nov 2023 14:46:13 -0500 Subject: Remove RSSDP --- RSSDP/HttpRequestParser.cs | 88 ---------------------------------------------- 1 file changed, 88 deletions(-) delete mode 100644 RSSDP/HttpRequestParser.cs (limited to 'RSSDP/HttpRequestParser.cs') diff --git a/RSSDP/HttpRequestParser.cs b/RSSDP/HttpRequestParser.cs deleted file mode 100644 index fab70eae2..000000000 --- a/RSSDP/HttpRequestParser.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System; -using System.Net.Http; -using Jellyfin.Extensions; - -namespace Rssdp.Infrastructure -{ - /// - /// Parses a string into a or throws an exception. - /// - public sealed class HttpRequestParser : HttpParserBase - { - private readonly string[] ContentHeaderNames = new string[] - { - "Allow", "Content-Disposition", "Content-Encoding", "Content-Language", "Content-Length", "Content-Location", "Content-MD5", "Content-Range", "Content-Type", "Expires", "Last-Modified" - }; - - /// - /// Parses the specified data into a instance. - /// - /// A string containing the data to parse. - /// A instance containing the parsed data. - public override HttpRequestMessage Parse(string data) - { - HttpRequestMessage retVal = null; - - try - { - retVal = new HttpRequestMessage(); - - Parse(retVal, retVal.Headers, data); - - return retVal; - } - finally - { - retVal?.Dispose(); - } - } - - /// - /// Used to parse the first line of an HTTP request or response and assign the values to the appropriate properties on the . - /// - /// The first line of the HTTP message to be parsed. - /// Either a or to assign the parsed values to. - protected override void ParseStatusLine(string data, HttpRequestMessage message) - { - if (data == null) - { - throw new ArgumentNullException(nameof(data)); - } - - if (message == null) - { - throw new ArgumentNullException(nameof(message)); - } - - var parts = data.Split(' '); - if (parts.Length < 2) - { - throw new ArgumentException("Status line is invalid. Insufficient status parts.", nameof(data)); - } - - message.Method = new HttpMethod(parts[0].Trim()); - if (Uri.TryCreate(parts[1].Trim(), UriKind.RelativeOrAbsolute, out var requestUri)) - { - message.RequestUri = requestUri; - } - else - { - System.Diagnostics.Debug.WriteLine(parts[1]); - } - - if (parts.Length >= 3) - { - message.Version = ParseHttpVersion(parts[2].Trim()); - } - } - - /// - /// Returns a boolean indicating whether the specified HTTP header name represents a content header (true), or a message header (false). - /// - /// A string containing the name of the header to return the type of. - protected override bool IsContentHeader(string headerName) - { - return ContentHeaderNames.Contains(headerName, StringComparison.OrdinalIgnoreCase); - } - } -} -- cgit v1.2.3