-
Notifications
You must be signed in to change notification settings - Fork 9.8k
/
ResponseCompressionOptions.cs
38 lines (32 loc) · 1.42 KB
/
ResponseCompressionOptions.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
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Linq;
using Microsoft.AspNetCore.Http.Features;
namespace Microsoft.AspNetCore.ResponseCompression;
/// <summary>
/// Options for the HTTP response compression middleware.
/// </summary>
public class ResponseCompressionOptions
{
/// <summary>
/// Response Content-Type MIME types to compress.
/// </summary>
public IEnumerable<string> MimeTypes { get; set; } = Enumerable.Empty<string>();
/// <summary>
/// Response Content-Type MIME types to not compress.
/// </summary>
public IEnumerable<string> ExcludedMimeTypes { get; set; } = Enumerable.Empty<string>();
/// <summary>
/// Indicates if responses over HTTPS connections should be compressed. The default is 'false'.
/// Enabling compression on HTTPS requests for remotely manipulable content may expose security problems.
/// </summary>
/// <remarks>
/// This can be overridden per request using <see cref="IHttpsCompressionFeature"/>.
/// </remarks>
public bool EnableForHttps { get; set; }
/// <summary>
/// The <see cref="ICompressionProvider"/> types to use for responses.
/// Providers are prioritized based on the order they are added.
/// </summary>
public CompressionProviderCollection Providers { get; } = new CompressionProviderCollection();
}