-
Notifications
You must be signed in to change notification settings - Fork 0
/
AppBuilderOptions.cs
84 lines (75 loc) · 2.5 KB
/
AppBuilderOptions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
namespace SystemLibrary.Common.Web.Extensions;
/// <summary>
/// Web Application Builder Options
///
/// All options are 'true' (on) by default
///
/// - Used as argument in 'app.CommonWebApplicationBuilder' function
/// </summary>
/// <example>
/// Startup.cs/Program.cs:
/// <code>
/// public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
/// {
/// var options = new AppBuilderOptions();
///
/// options.UseHttpRedrectionAndHsts = false;
///
/// app.CommonWebApplicationBuilder(options);
/// }
/// </code>
/// </example>
public class AppBuilderOptions : BaseOptions
{
/// <summary>
/// Adds middleware for http to https redirect client side, aka hsts
/// </summary>
public bool UseHsts = true;
/// <summary>
/// Adds the routing middleware that comes with Aspnet
/// </summary>
public bool UseRouting = true;
/// <summary>
/// Adds middleware for Authorization and Authentication attributes
/// </summary>
public bool UseAuthentication = true;
/// <summary>
/// Adds middleware for Authorization attributes
/// </summary>
public bool UseAuthorization = true;
/// <summary>
/// Adds middleware for static files and sets a few default settings:
/// - allows serving of unknown files types
/// - compression is set to 'HttpsCompressionMode.Compress'
/// - does not append a trailing slash for static files
/// </summary>
public bool UseStaticFiles = true;
/// <summary>
/// Set the cache-control max age header to a duration for all static requests
///
/// Note: requires UseStaticFiles set to True, and the header 'max-age' cannot be added already in the response
///
/// Default: two weeks
/// </summary>
public int StaticFilesMaxAgeSeconds = 1209600;
/// <summary>
/// Allow serving of unknown, unsupported, media/mime types.
///
/// Note: requires UseStatisFiles set to True
///
/// Defaults to true
/// </summary>
public bool StaticFilesServeUnknownFileTypes = true;
/// <summary>
/// Set the relative path of where to only allow serving static content from
///
/// Note: requires UseStatisFiles set to True
///
/// For example: /static
/// </summary>
public string StaticFilesRequestPath = null;
/// <summary>
/// Adds middleware which responds with a exception page usually used in development environments and test environments
/// </summary>
public bool UseDeveloperPage = true;
}