diff --git a/src/Microsoft.AspNet.Http.Abstractions/Authentication/AuthenticationDescription.cs b/src/Microsoft.AspNet.Http.Abstractions/Authentication/AuthenticationDescription.cs index 0ee24024e5..d6f9bf08a7 100644 --- a/src/Microsoft.AspNet.Http.Abstractions/Authentication/AuthenticationDescription.cs +++ b/src/Microsoft.AspNet.Http.Abstractions/Authentication/AuthenticationDescription.cs @@ -36,7 +36,7 @@ namespace Microsoft.AspNet.Http.Authentication /// /// Contains metadata about the authentication provider. /// - public IDictionary Items { get; private set; } + public IDictionary Items { get; } /// /// Gets or sets the name used to reference the authentication middleware instance. diff --git a/src/Microsoft.AspNet.Http.Abstractions/Authentication/AuthenticationProperties.cs b/src/Microsoft.AspNet.Http.Abstractions/Authentication/AuthenticationProperties.cs index ab17713ab0..5c815ba37b 100644 --- a/src/Microsoft.AspNet.Http.Abstractions/Authentication/AuthenticationProperties.cs +++ b/src/Microsoft.AspNet.Http.Abstractions/Authentication/AuthenticationProperties.cs @@ -40,7 +40,7 @@ namespace Microsoft.AspNet.Http.Authentication /// /// State values about the authentication session. /// - public IDictionary Items { get; private set; } + public IDictionary Items { get; } /// /// Gets or sets whether the authentication session is persisted across multiple requests. diff --git a/src/Microsoft.AspNet.Http.Extensions/FormFileExtensions.cs b/src/Microsoft.AspNet.Http.Extensions/FormFileExtensions.cs index 7b13bc2ac3..fa68ae340a 100644 --- a/src/Microsoft.AspNet.Http.Extensions/FormFileExtensions.cs +++ b/src/Microsoft.AspNet.Http.Extensions/FormFileExtensions.cs @@ -40,9 +40,10 @@ namespace Microsoft.AspNet.Http /// /// The . /// The name of the file to create. - public async static Task SaveAsAsync(this IFormFile formFile, - string filename, - CancellationToken cancellationToken = default(CancellationToken)) + public async static Task SaveAsAsync( + this IFormFile formFile, + string filename, + CancellationToken cancellationToken = default(CancellationToken)) { if (formFile == null) { diff --git a/src/Microsoft.AspNet.Http.Extensions/RequestHeaders.cs b/src/Microsoft.AspNet.Http.Extensions/RequestHeaders.cs index efaa73fc14..4b31e30615 100644 --- a/src/Microsoft.AspNet.Http.Extensions/RequestHeaders.cs +++ b/src/Microsoft.AspNet.Http.Extensions/RequestHeaders.cs @@ -20,7 +20,7 @@ namespace Microsoft.AspNet.Http.Headers Headers = headers; } - public IHeaderDictionary Headers { get; private set; } + public IHeaderDictionary Headers { get; } public IList Accept { diff --git a/src/Microsoft.AspNet.Http.Extensions/ResponseHeaders.cs b/src/Microsoft.AspNet.Http.Extensions/ResponseHeaders.cs index de719d58ec..e7cb97ad3f 100644 --- a/src/Microsoft.AspNet.Http.Extensions/ResponseHeaders.cs +++ b/src/Microsoft.AspNet.Http.Extensions/ResponseHeaders.cs @@ -21,7 +21,7 @@ namespace Microsoft.AspNet.Http.Headers Headers = headers; } - public IHeaderDictionary Headers { get; private set; } + public IHeaderDictionary Headers { get; } public CacheControlHeaderValue CacheControl { diff --git a/src/Microsoft.AspNet.Http.Extensions/UriHelper.cs b/src/Microsoft.AspNet.Http.Extensions/UriHelper.cs index 3e137acc2e..84143af242 100644 --- a/src/Microsoft.AspNet.Http.Extensions/UriHelper.cs +++ b/src/Microsoft.AspNet.Http.Extensions/UriHelper.cs @@ -18,7 +18,8 @@ namespace Microsoft.AspNet.Http.Extensions /// /// /// - public static string Encode(PathString pathBase = new PathString(), + public static string Encode( + PathString pathBase = new PathString(), PathString path = new PathString(), QueryString query = new QueryString(), FragmentString fragment = new FragmentString()) @@ -38,7 +39,8 @@ namespace Microsoft.AspNet.Http.Extensions /// /// /// - public static string Encode(string scheme, + public static string Encode( + string scheme, HostString host, PathString pathBase = new PathString(), PathString path = new PathString(), diff --git a/src/Microsoft.AspNet.Http/ItemsDictionary.cs b/src/Microsoft.AspNet.Http/ItemsDictionary.cs index e191516849..90e9cd3138 100644 --- a/src/Microsoft.AspNet.Http/ItemsDictionary.cs +++ b/src/Microsoft.AspNet.Http/ItemsDictionary.cs @@ -18,7 +18,7 @@ namespace Microsoft.AspNet.Http.Internal Items = items; } - public IDictionary Items { get; private set; } + public IDictionary Items { get; } // Replace the indexer with one that returns null for missing values object IDictionary.this[object key] diff --git a/src/Microsoft.Net.Http.Headers/CacheControlHeaderValue.cs b/src/Microsoft.Net.Http.Headers/CacheControlHeaderValue.cs index c1940754ba..b8b6d2726c 100644 --- a/src/Microsoft.Net.Http.Headers/CacheControlHeaderValue.cs +++ b/src/Microsoft.Net.Http.Headers/CacheControlHeaderValue.cs @@ -390,7 +390,8 @@ namespace Microsoft.Net.Http.Headers return input.Length - startIndex; } - private static bool TrySetCacheControlValues(CacheControlHeaderValue cc, + private static bool TrySetCacheControlValues( + CacheControlHeaderValue cc, List nameValueList) { foreach (NameValueHeaderValue nameValue in nameValueList) @@ -477,7 +478,9 @@ namespace Microsoft.Net.Http.Headers return true; } - private static bool TrySetOptionalTokenList(NameValueHeaderValue nameValue, ref bool boolField, + private static bool TrySetOptionalTokenList( + NameValueHeaderValue nameValue, + ref bool boolField, ref ICollection destination) { Contract.Requires(nameValue != null); diff --git a/src/Microsoft.Net.Http.Headers/ContentRangeHeaderValue.cs b/src/Microsoft.Net.Http.Headers/ContentRangeHeaderValue.cs index 092bb83320..c24b42758a 100644 --- a/src/Microsoft.Net.Http.Headers/ContentRangeHeaderValue.cs +++ b/src/Microsoft.Net.Http.Headers/ContentRangeHeaderValue.cs @@ -340,8 +340,16 @@ namespace Microsoft.Net.Http.Headers return true; } - private static bool TryCreateContentRange(string input, string unit, int fromStartIndex, int fromLength, - int toStartIndex, int toLength, int lengthStartIndex, int lengthLength, out ContentRangeHeaderValue parsedValue) + private static bool TryCreateContentRange( + string input, + string unit, + int fromStartIndex, + int fromLength, + int toStartIndex, + int toLength, + int lengthStartIndex, + int lengthLength, + out ContentRangeHeaderValue parsedValue) { parsedValue = null; diff --git a/src/Microsoft.Net.Http.Headers/HeaderUtilities.cs b/src/Microsoft.Net.Http.Headers/HeaderUtilities.cs index 630e02b93f..3885477aa1 100644 --- a/src/Microsoft.Net.Http.Headers/HeaderUtilities.cs +++ b/src/Microsoft.Net.Http.Headers/HeaderUtilities.cs @@ -163,7 +163,10 @@ namespace Microsoft.Net.Http.Headers return true; } - internal static int GetNextNonEmptyOrWhitespaceIndex(string input, int startIndex, bool skipEmptyValues, + internal static int GetNextNonEmptyOrWhitespaceIndex( + string input, + int startIndex, + bool skipEmptyValues, out bool separatorFound) { Contract.Requires(input != null); diff --git a/src/Microsoft.Net.Http.Headers/HttpRuleParser.cs b/src/Microsoft.Net.Http.Headers/HttpRuleParser.cs index 188ffe1389..b1690e96fd 100644 --- a/src/Microsoft.Net.Http.Headers/HttpRuleParser.cs +++ b/src/Microsoft.Net.Http.Headers/HttpRuleParser.cs @@ -35,8 +35,8 @@ namespace Microsoft.Net.Http.Headers internal const char CR = '\r'; internal const char LF = '\n'; - internal const char SP = ' '; - internal const char Tab = '\t'; + internal const char SP = ' '; + internal const char Tab = '\t'; internal const int MaxInt64Digits = 19; internal const int MaxInt32Digits = 10; @@ -263,8 +263,14 @@ namespace Microsoft.Net.Http.Headers // "(((((comment)))))". If we wouldn't define a limit an attacker could send a comment with hundreds of nested // comments, resulting in a stack overflow exception. In addition having more than 1 nested comment (if any) // is unusual. - private static HttpParseResult GetExpressionLength(string input, int startIndex, char openChar, - char closeChar, bool supportsNesting, ref int nestedCount, out int length) + private static HttpParseResult GetExpressionLength( + string input, + int startIndex, + char openChar, + char closeChar, + bool supportsNesting, + ref int nestedCount, + out int length) { Contract.Requires(input != null); Contract.Requires((startIndex >= 0) && (startIndex < input.Length)); diff --git a/src/Microsoft.Net.Http.Headers/MediaTypeHeaderValueComparer.cs b/src/Microsoft.Net.Http.Headers/MediaTypeHeaderValueComparer.cs index a64b12e6b0..21ab21f71e 100644 --- a/src/Microsoft.Net.Http.Headers/MediaTypeHeaderValueComparer.cs +++ b/src/Microsoft.Net.Http.Headers/MediaTypeHeaderValueComparer.cs @@ -79,8 +79,9 @@ namespace Microsoft.Net.Http.Headers return returnValue; } - private static int CompareBasedOnQualityFactor(MediaTypeHeaderValue mediaType1, - MediaTypeHeaderValue mediaType2) + private static int CompareBasedOnQualityFactor( + MediaTypeHeaderValue mediaType1, + MediaTypeHeaderValue mediaType2) { var mediaType1Quality = mediaType1.Quality ?? HeaderQuality.Match; var mediaType2Quality = mediaType2.Quality ?? HeaderQuality.Match; diff --git a/src/Microsoft.Net.Http.Headers/NameValueHeaderValue.cs b/src/Microsoft.Net.Http.Headers/NameValueHeaderValue.cs index f5b1c72435..3031d877c0 100644 --- a/src/Microsoft.Net.Http.Headers/NameValueHeaderValue.cs +++ b/src/Microsoft.Net.Http.Headers/NameValueHeaderValue.cs @@ -172,7 +172,10 @@ namespace Microsoft.Net.Http.Headers return _name; } - internal static void ToString(ICollection values, char separator, bool leadingSeparator, + internal static void ToString( + ICollection values, + char separator, + bool leadingSeparator, StringBuilder destination) { Contract.Assert(destination != null); @@ -275,7 +278,10 @@ namespace Microsoft.Net.Http.Headers // Returns the length of a name/value list, separated by 'delimiter'. E.g. "a=b, c=d, e=f" adds 3 // name/value pairs to 'nameValueCollection' if 'delimiter' equals ','. - internal static int GetNameValueListLength(string input, int startIndex, char delimiter, + internal static int GetNameValueListLength( + string input, + int startIndex, + char delimiter, ICollection nameValueCollection) { Contract.Requires(nameValueCollection != null); diff --git a/src/Microsoft.Net.Http.Headers/RangeItemHeaderValue.cs b/src/Microsoft.Net.Http.Headers/RangeItemHeaderValue.cs index 772a1c923a..ce62e99f2a 100644 --- a/src/Microsoft.Net.Http.Headers/RangeItemHeaderValue.cs +++ b/src/Microsoft.Net.Http.Headers/RangeItemHeaderValue.cs @@ -86,12 +86,14 @@ namespace Microsoft.Net.Http.Headers // Returns the length of a range list. E.g. "1-2, 3-4, 5-6" adds 3 ranges to 'rangeCollection'. Note that empty // list segments are allowed, e.g. ",1-2, , 3-4,,". - internal static int GetRangeItemListLength(string input, int startIndex, + internal static int GetRangeItemListLength( + string input, + int startIndex, ICollection rangeCollection) { Contract.Requires(rangeCollection != null); Contract.Requires(startIndex >= 0); - Contract.Ensures((Contract.Result() == 0) || (rangeCollection.Count > 0), + Contract.Ensures((Contract.Result() == 0) || (rangeCollection.Count > 0), "If we can parse the string, then we expect to have at least one range item."); if ((string.IsNullOrEmpty(input)) || (startIndex >= input.Length)) diff --git a/src/Microsoft.Net.Http.Headers/StringWithQualityHeaderValueComparer.cs b/src/Microsoft.Net.Http.Headers/StringWithQualityHeaderValueComparer.cs index 2dfa0509ad..6dc3d0758a 100644 --- a/src/Microsoft.Net.Http.Headers/StringWithQualityHeaderValueComparer.cs +++ b/src/Microsoft.Net.Http.Headers/StringWithQualityHeaderValueComparer.cs @@ -38,8 +38,9 @@ namespace Microsoft.Net.Http.Headers /// The first value to compare. /// The second value to compare /// The result of the comparison. - public int Compare(StringWithQualityHeaderValue stringWithQuality1, - StringWithQualityHeaderValue stringWithQuality2) + public int Compare( + StringWithQualityHeaderValue stringWithQuality1, + StringWithQualityHeaderValue stringWithQuality2) { if (stringWithQuality1 == null) { diff --git a/test/Microsoft.Net.Http.Headers.Tests/ContentDispositionHeaderValueTest.cs b/test/Microsoft.Net.Http.Headers.Tests/ContentDispositionHeaderValueTest.cs index 02e233a53d..89b1ab0f10 100644 --- a/test/Microsoft.Net.Http.Headers.Tests/ContentDispositionHeaderValueTest.cs +++ b/test/Microsoft.Net.Http.Headers.Tests/ContentDispositionHeaderValueTest.cs @@ -569,11 +569,11 @@ namespace Microsoft.Net.Http.Headers Valid = valid; } - public string Value { get; private set; } + public string Value { get; } - public string Description { get; private set; } + public string Description { get; } - public bool Valid { get; private set; } + public bool Valid { get; } } private void CheckValidParse(string input, ContentDispositionHeaderValue expectedResult)