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

Commit 7ebd87a

Browse files
committed
Add doc comments for FormOptions.
1 parent 3a7f6a7 commit 7ebd87a

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

src/Microsoft.AspNetCore.Http/Features/FormOptions.cs

+52
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

4+
using System.IO;
45
using Microsoft.AspNetCore.WebUtilities;
56

67
namespace Microsoft.AspNetCore.Http.Features
@@ -12,15 +13,66 @@ public class FormOptions
1213
public const int DefaultMultipartBoundaryLengthLimit = 128;
1314
public const long DefaultMultipartBodyLengthLimit = 1024 * 1024 * 128;
1415

16+
/// <summary>
17+
/// Enables full request body buffering. Use this if multiple components need to read the raw stream.
18+
/// The default value is false.
19+
/// </summary>
1520
public bool BufferBody { get; set; } = false;
21+
22+
/// <summary>
23+
/// If <see cref="BufferBody"/> is enabled, this many bytes of the body will be buffered in memory.
24+
/// If this threshold is exceeded then the buffer will be moved to a temp file on disk instead.
25+
/// This also applies when buffering individual multipart section bodies.
26+
/// </summary>
1627
public int MemoryBufferThreshold { get; set; } = DefaultMemoryBufferThreshold;
28+
29+
/// <summary>
30+
/// If <see cref="BufferBody"/> is enabled, this is the limit for the total number of bytes that will
31+
/// be buffered. Forms that exceed this limit will throw an <see cref="InvalidDataException"/> when parsed.
32+
/// </summary>
1733
public long BufferBodyLengthLimit { get; set; } = DefaultBufferBodyLengthLimit;
34+
35+
/// <summary>
36+
/// A limit for the number of form entries to allow. Entries with the same key will be combined.
37+
/// Forms that exceed this limit will throw an <see cref="InvalidDataException"/> when parsed.
38+
/// </summary>
1839
public int KeyCountLimit { get; set; } = FormReader.DefaultKeyCountLimit;
40+
41+
/// <summary>
42+
/// A limit on the length of individual keys. Forms containing keys that exceed this limit will
43+
/// throw an <see cref="InvalidDataException"/> when parsed.
44+
/// </summary>
1945
public int KeyLengthLimit { get; set; } = FormReader.DefaultKeyLengthLimit;
46+
47+
/// <summary>
48+
/// A limit on the length of individual form values. Forms containing values that exceed this
49+
/// limit will throw an <see cref="InvalidDataException"/> when parsed.
50+
/// </summary>
2051
public int ValueLengthLimit { get; set; } = FormReader.DefaultValueLengthLimit;
52+
53+
/// <summary>
54+
/// A limit for the length of the boundary identifier. Forms with boundaries that exceed this
55+
/// limit will throw an <see cref="InvalidDataException"/> when parsed.
56+
/// </summary>
2157
public int MultipartBoundaryLengthLimit { get; set; } = DefaultMultipartBoundaryLengthLimit;
58+
59+
/// <summary>
60+
/// A limit for the number of headers to allow in each multipart section. Headers with the same name will
61+
/// be combined. Form sections that exceed this limit will throw an <see cref="InvalidDataException"/>
62+
/// when parsed.
63+
/// </summary>
2264
public int MultipartHeadersCountLimit { get; set; } = MultipartReader.DefaultHeadersCountLimit;
65+
66+
/// <summary>
67+
/// A limit for the total length of the header keys and values in each multipart section.
68+
/// Form sections that exceed this limit will throw an <see cref="InvalidDataException"/> when parsed.
69+
/// </summary>
2370
public int MultipartHeadersLengthLimit { get; set; } = MultipartReader.DefaultHeadersLengthLimit;
71+
72+
/// <summary>
73+
/// A limit for the length of each multipart body. Forms sections that exceed this limit will throw an
74+
/// <see cref="InvalidDataException"/> when parsed.
75+
/// </summary>
2476
public long MultipartBodyLengthLimit { get; set; } = DefaultMultipartBodyLengthLimit;
2577
}
2678
}

0 commit comments

Comments
 (0)