Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Commit ceded80

Browse files
committed
Formatting fixes
1 parent 58974a9 commit ceded80

File tree

16 files changed

+63
-30
lines changed

16 files changed

+63
-30
lines changed

src/Microsoft.AspNet.Http.Abstractions/Authentication/AuthenticationDescription.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public AuthenticationDescription(IDictionary<string, object> items)
3636
/// <summary>
3737
/// Contains metadata about the authentication provider.
3838
/// </summary>
39-
public IDictionary<string, object> Items { get; private set; }
39+
public IDictionary<string, object> Items { get; }
4040

4141
/// <summary>
4242
/// Gets or sets the name used to reference the authentication middleware instance.

src/Microsoft.AspNet.Http.Abstractions/Authentication/AuthenticationProperties.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public AuthenticationProperties(IDictionary<string, string> items)
4040
/// <summary>
4141
/// State values about the authentication session.
4242
/// </summary>
43-
public IDictionary<string, string> Items { get; private set; }
43+
public IDictionary<string, string> Items { get; }
4444

4545
/// <summary>
4646
/// Gets or sets whether the authentication session is persisted across multiple requests.

src/Microsoft.AspNet.Http.Extensions/FormFileExtensions.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ public static void SaveAs(this IFormFile formFile, string filename)
4040
/// </summary>
4141
/// <param name="formFile">The <see cref="IFormFile"/>.</param>
4242
/// <param name="filename">The name of the file to create.</param>
43-
public async static Task SaveAsAsync(this IFormFile formFile,
44-
string filename,
45-
CancellationToken cancellationToken = default(CancellationToken))
43+
public async static Task SaveAsAsync(
44+
this IFormFile formFile,
45+
string filename,
46+
CancellationToken cancellationToken = default(CancellationToken))
4647
{
4748
if (formFile == null)
4849
{

src/Microsoft.AspNet.Http.Extensions/RequestHeaders.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public RequestHeaders(IHeaderDictionary headers)
2020
Headers = headers;
2121
}
2222

23-
public IHeaderDictionary Headers { get; private set; }
23+
public IHeaderDictionary Headers { get; }
2424

2525
public IList<MediaTypeHeaderValue> Accept
2626
{

src/Microsoft.AspNet.Http.Extensions/ResponseHeaders.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public ResponseHeaders(IHeaderDictionary headers)
2121
Headers = headers;
2222
}
2323

24-
public IHeaderDictionary Headers { get; private set; }
24+
public IHeaderDictionary Headers { get; }
2525

2626
public CacheControlHeaderValue CacheControl
2727
{

src/Microsoft.AspNet.Http.Extensions/UriHelper.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ public static class UriHelper
1818
/// <param name="query"></param>
1919
/// <param name="fragment"></param>
2020
/// <returns></returns>
21-
public static string Encode(PathString pathBase = new PathString(),
21+
public static string Encode(
22+
PathString pathBase = new PathString(),
2223
PathString path = new PathString(),
2324
QueryString query = new QueryString(),
2425
FragmentString fragment = new FragmentString())
@@ -38,7 +39,8 @@ public static class UriHelper
3839
/// <param name="query"></param>
3940
/// <param name="fragment"></param>
4041
/// <returns></returns>
41-
public static string Encode(string scheme,
42+
public static string Encode(
43+
string scheme,
4244
HostString host,
4345
PathString pathBase = new PathString(),
4446
PathString path = new PathString(),

src/Microsoft.AspNet.Http/ItemsDictionary.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public ItemsDictionary(IDictionary<object, object> items)
1818
Items = items;
1919
}
2020

21-
public IDictionary<object, object> Items { get; private set; }
21+
public IDictionary<object, object> Items { get; }
2222

2323
// Replace the indexer with one that returns null for missing values
2424
object IDictionary<object, object>.this[object key]

src/Microsoft.Net.Http.Headers/CacheControlHeaderValue.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,8 @@ private static int GetCacheControlLength(string input, int startIndex, out Cache
390390
return input.Length - startIndex;
391391
}
392392

393-
private static bool TrySetCacheControlValues(CacheControlHeaderValue cc,
393+
private static bool TrySetCacheControlValues(
394+
CacheControlHeaderValue cc,
394395
List<NameValueHeaderValue> nameValueList)
395396
{
396397
foreach (NameValueHeaderValue nameValue in nameValueList)
@@ -477,7 +478,9 @@ private static bool TrySetTokenOnlyValue(NameValueHeaderValue nameValue, ref boo
477478
return true;
478479
}
479480

480-
private static bool TrySetOptionalTokenList(NameValueHeaderValue nameValue, ref bool boolField,
481+
private static bool TrySetOptionalTokenList(
482+
NameValueHeaderValue nameValue,
483+
ref bool boolField,
481484
ref ICollection<string> destination)
482485
{
483486
Contract.Requires(nameValue != null);

src/Microsoft.Net.Http.Headers/ContentRangeHeaderValue.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,16 @@ private static bool TryGetRangeLength(string input, ref int current, out int fro
340340
return true;
341341
}
342342

343-
private static bool TryCreateContentRange(string input, string unit, int fromStartIndex, int fromLength,
344-
int toStartIndex, int toLength, int lengthStartIndex, int lengthLength, out ContentRangeHeaderValue parsedValue)
343+
private static bool TryCreateContentRange(
344+
string input,
345+
string unit,
346+
int fromStartIndex,
347+
int fromLength,
348+
int toStartIndex,
349+
int toLength,
350+
int lengthStartIndex,
351+
int lengthLength,
352+
out ContentRangeHeaderValue parsedValue)
345353
{
346354
parsedValue = null;
347355

src/Microsoft.Net.Http.Headers/HeaderUtilities.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,10 @@ internal static bool AreEqualCollections<T>(ICollection<T> x, ICollection<T> y,
163163
return true;
164164
}
165165

166-
internal static int GetNextNonEmptyOrWhitespaceIndex(string input, int startIndex, bool skipEmptyValues,
166+
internal static int GetNextNonEmptyOrWhitespaceIndex(
167+
string input,
168+
int startIndex,
169+
bool skipEmptyValues,
167170
out bool separatorFound)
168171
{
169172
Contract.Requires(input != null);

src/Microsoft.Net.Http.Headers/HttpRuleParser.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ internal static class HttpRuleParser
3535

3636
internal const char CR = '\r';
3737
internal const char LF = '\n';
38-
internal const char SP = ' ';
39-
internal const char Tab = '\t';
38+
internal const char SP = ' ';
39+
internal const char Tab = '\t';
4040
internal const int MaxInt64Digits = 19;
4141
internal const int MaxInt32Digits = 10;
4242

@@ -263,8 +263,14 @@ internal static bool TryStringToDate(string input, out DateTimeOffset result)
263263
// "(((((comment)))))". If we wouldn't define a limit an attacker could send a comment with hundreds of nested
264264
// comments, resulting in a stack overflow exception. In addition having more than 1 nested comment (if any)
265265
// is unusual.
266-
private static HttpParseResult GetExpressionLength(string input, int startIndex, char openChar,
267-
char closeChar, bool supportsNesting, ref int nestedCount, out int length)
266+
private static HttpParseResult GetExpressionLength(
267+
string input,
268+
int startIndex,
269+
char openChar,
270+
char closeChar,
271+
bool supportsNesting,
272+
ref int nestedCount,
273+
out int length)
268274
{
269275
Contract.Requires(input != null);
270276
Contract.Requires((startIndex >= 0) && (startIndex < input.Length));

src/Microsoft.Net.Http.Headers/MediaTypeHeaderValueComparer.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@ public int Compare(MediaTypeHeaderValue mediaType1, MediaTypeHeaderValue mediaTy
7979
return returnValue;
8080
}
8181

82-
private static int CompareBasedOnQualityFactor(MediaTypeHeaderValue mediaType1,
83-
MediaTypeHeaderValue mediaType2)
82+
private static int CompareBasedOnQualityFactor(
83+
MediaTypeHeaderValue mediaType1,
84+
MediaTypeHeaderValue mediaType2)
8485
{
8586
var mediaType1Quality = mediaType1.Quality ?? HeaderQuality.Match;
8687
var mediaType2Quality = mediaType2.Quality ?? HeaderQuality.Match;

src/Microsoft.Net.Http.Headers/NameValueHeaderValue.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,10 @@ public override string ToString()
172172
return _name;
173173
}
174174

175-
internal static void ToString(ICollection<NameValueHeaderValue> values, char separator, bool leadingSeparator,
175+
internal static void ToString(
176+
ICollection<NameValueHeaderValue> values,
177+
char separator,
178+
bool leadingSeparator,
176179
StringBuilder destination)
177180
{
178181
Contract.Assert(destination != null);
@@ -275,7 +278,10 @@ private static int GetNameValueLength(string input, int startIndex, out NameValu
275278

276279
// Returns the length of a name/value list, separated by 'delimiter'. E.g. "a=b, c=d, e=f" adds 3
277280
// name/value pairs to 'nameValueCollection' if 'delimiter' equals ','.
278-
internal static int GetNameValueListLength(string input, int startIndex, char delimiter,
281+
internal static int GetNameValueListLength(
282+
string input,
283+
int startIndex,
284+
char delimiter,
279285
ICollection<NameValueHeaderValue> nameValueCollection)
280286
{
281287
Contract.Requires(nameValueCollection != null);

src/Microsoft.Net.Http.Headers/RangeItemHeaderValue.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,14 @@ public override int GetHashCode()
8686

8787
// Returns the length of a range list. E.g. "1-2, 3-4, 5-6" adds 3 ranges to 'rangeCollection'. Note that empty
8888
// list segments are allowed, e.g. ",1-2, , 3-4,,".
89-
internal static int GetRangeItemListLength(string input, int startIndex,
89+
internal static int GetRangeItemListLength(
90+
string input,
91+
int startIndex,
9092
ICollection<RangeItemHeaderValue> rangeCollection)
9193
{
9294
Contract.Requires(rangeCollection != null);
9395
Contract.Requires(startIndex >= 0);
94-
Contract.Ensures((Contract.Result<int>() == 0) || (rangeCollection.Count > 0),
96+
Contract.Ensures((Contract.Result<int>() == 0) || (rangeCollection.Count > 0),
9597
"If we can parse the string, then we expect to have at least one range item.");
9698

9799
if ((string.IsNullOrEmpty(input)) || (startIndex >= input.Length))

src/Microsoft.Net.Http.Headers/StringWithQualityHeaderValueComparer.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ public static StringWithQualityHeaderValueComparer QualityComparer
3838
/// <param name="stringWithQuality1">The first value to compare.</param>
3939
/// <param name="stringWithQuality2">The second value to compare</param>
4040
/// <returns>The result of the comparison.</returns>
41-
public int Compare(StringWithQualityHeaderValue stringWithQuality1,
42-
StringWithQualityHeaderValue stringWithQuality2)
41+
public int Compare(
42+
StringWithQualityHeaderValue stringWithQuality1,
43+
StringWithQualityHeaderValue stringWithQuality2)
4344
{
4445
if (stringWithQuality1 == null)
4546
{

test/Microsoft.Net.Http.Headers.Tests/ContentDispositionHeaderValueTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -569,11 +569,11 @@ public ContentDispositionValue(string value, string description, bool valid)
569569
Valid = valid;
570570
}
571571

572-
public string Value { get; private set; }
572+
public string Value { get; }
573573

574-
public string Description { get; private set; }
574+
public string Description { get; }
575575

576-
public bool Valid { get; private set; }
576+
public bool Valid { get; }
577577
}
578578

579579
private void CheckValidParse(string input, ContentDispositionHeaderValue expectedResult)

0 commit comments

Comments
 (0)