From bc0732f9007f8e2c2e1feb8904c0e4779cfe8a37 Mon Sep 17 00:00:00 2001 From: Chris Ross Date: Thu, 21 Aug 2014 12:13:26 -0700 Subject: [PATCH] Code cleanup. --- src/Microsoft.AspNet.Http/HostString.cs | 8 ++++---- src/Microsoft.AspNet.Http/PathString.cs | 2 +- .../Infrastructure/ParsingHelpers.cs | 12 +----------- src/Microsoft.AspNet.WebUtilities/ParsingHelpers.cs | 2 +- src/Microsoft.AspNet.WebUtilities/QueryHelpers.cs | 6 +++--- 5 files changed, 10 insertions(+), 20 deletions(-) diff --git a/src/Microsoft.AspNet.Http/HostString.cs b/src/Microsoft.AspNet.Http/HostString.cs index 7e4381f9f1..67af893b19 100644 --- a/src/Microsoft.AspNet.Http/HostString.cs +++ b/src/Microsoft.AspNet.Http/HostString.cs @@ -8,7 +8,7 @@ using System.Globalization; namespace Microsoft.AspNet.Http { /// - /// Represents the host portion of a Uri can be used to construct Uri's properly formatted and encoded for use in + /// Represents the host portion of a URI can be used to construct URI's properly formatted and encoded for use in /// HTTP headers. /// public struct HostString : IEquatable @@ -47,7 +47,7 @@ namespace Microsoft.AspNet.Http /// Any Unicode is converted to punycode. IPv6 addresses will have brackets added if they are missing. /// /// - [SuppressMessage("Microsoft.Design", "CA1055:UriReturnValuesShouldNotBeStrings", Justification = "Only the host segment of a uri is returned.")] + [SuppressMessage("Microsoft.Design", "CA1055:UriReturnValuesShouldNotBeStrings", Justification = "Only the host segment of a URI is returned.")] public string ToUriComponent() { int index; @@ -82,12 +82,12 @@ namespace Microsoft.AspNet.Http } /// - /// Creates a new HostString from the given uri component. + /// Creates a new HostString from the given URI component. /// Any punycode will be converted to Unicode. /// /// /// - [SuppressMessage("Microsoft.Design", "CA1057:StringUriOverloadsCallSystemUriOverloads", Justification = "Only the host segment of a uri is provided.")] + [SuppressMessage("Microsoft.Design", "CA1057:StringUriOverloadsCallSystemUriOverloads", Justification = "Only the host segment of a URI is provided.")] public static HostString FromUriComponent(string uriComponent) { if (!string.IsNullOrEmpty(uriComponent)) diff --git a/src/Microsoft.AspNet.Http/PathString.cs b/src/Microsoft.AspNet.Http/PathString.cs index a6cf0c85b3..05dfa6d816 100644 --- a/src/Microsoft.AspNet.Http/PathString.cs +++ b/src/Microsoft.AspNet.Http/PathString.cs @@ -74,7 +74,7 @@ namespace Microsoft.AspNet.Http /// /// The escaped path as it appears in the URI format. /// The resulting PathString - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1057:StringUriOverloadsCallSystemUriOverloads", Justification = "Requirements not compatible with Uri processing")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1057:StringUriOverloadsCallSystemUriOverloads", Justification = "Requirements not compatible with URI processing")] public static PathString FromUriComponent(string uriComponent) { // REVIEW: what is the exactly correct thing to do? diff --git a/src/Microsoft.AspNet.PipelineCore/Infrastructure/ParsingHelpers.cs b/src/Microsoft.AspNet.PipelineCore/Infrastructure/ParsingHelpers.cs index 2ede1ab15c..f1db7fe748 100644 --- a/src/Microsoft.AspNet.PipelineCore/Infrastructure/ParsingHelpers.cs +++ b/src/Microsoft.AspNet.PipelineCore/Infrastructure/ParsingHelpers.cs @@ -8,7 +8,6 @@ using System.Globalization; using System.Linq; using Microsoft.AspNet.Http; using Microsoft.AspNet.Http.Infrastructure; -using Microsoft.AspNet.PipelineCore.Collections; namespace Microsoft.AspNet.PipelineCore.Infrastructure { @@ -507,7 +506,7 @@ namespace Microsoft.AspNet.PipelineCore.Infrastructure } } - internal static partial class ParsingHelpers + internal static class ParsingHelpers { private static readonly Action AddCookieCallback = (name, value, state) => { @@ -592,10 +591,7 @@ namespace Microsoft.AspNet.PipelineCore.Infrastructure scanIndex = delimiterIndex + 1; } } - } - internal static partial class ParsingHelpers - { public static string GetHeader(IDictionary headers, string key) { string[] values = GetHeaderUnmodified(headers, key); @@ -783,10 +779,7 @@ namespace Microsoft.AspNet.PipelineCore.Infrastructure SetHeaderUnmodified(headers, key, existing.Concat(values)); } } - } - internal static partial class ParsingHelpers - { private static readonly Action AppendItemCallback = (name, value, state) => { var dictionary = (IDictionary>)state; @@ -833,10 +826,7 @@ namespace Microsoft.AspNet.PipelineCore.Infrastructure string[] values; return store.TryGetValue(key, out values) ? values : null; } - } - internal static partial class ParsingHelpers - { //internal static string GetHost(HttpRequest request) //{ // IHeaderDictionary headers = request.Headers; diff --git a/src/Microsoft.AspNet.WebUtilities/ParsingHelpers.cs b/src/Microsoft.AspNet.WebUtilities/ParsingHelpers.cs index c9f4e6f544..e5dbd65a9c 100644 --- a/src/Microsoft.AspNet.WebUtilities/ParsingHelpers.cs +++ b/src/Microsoft.AspNet.WebUtilities/ParsingHelpers.cs @@ -8,7 +8,7 @@ using Microsoft.AspNet.WebUtilities.Collections; namespace Microsoft.AspNet.WebUtilities { - internal static partial class ParsingHelpers + internal static class ParsingHelpers { internal static void ParseDelimited(string text, char[] delimiters, Action callback, object state) { diff --git a/src/Microsoft.AspNet.WebUtilities/QueryHelpers.cs b/src/Microsoft.AspNet.WebUtilities/QueryHelpers.cs index 27b8a96ded..0b4de851bc 100644 --- a/src/Microsoft.AspNet.WebUtilities/QueryHelpers.cs +++ b/src/Microsoft.AspNet.WebUtilities/QueryHelpers.cs @@ -5,12 +5,12 @@ namespace Microsoft.AspNet.WebUtilities public static class QueryHelpers { /// - /// Append the given query key and value to the uri. + /// Append the given query key and value to the URI. /// - /// The base uri. + /// The base URI. /// The name of the query key. /// The query value. - /// The combine result. + /// The combined result. public static string AddQueryString([NotNull] string uri, [NotNull] string name, [NotNull] string value) { bool hasQuery = uri.IndexOf('?') != -1;