-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Support conditional compression #8239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
namespace Microsoft.AspNetCore.Http.Features | ||
{ | ||
/// <summary> | ||
/// Use to dynamically control response compression for HTTPS requests. | ||
/// </summary> | ||
public enum HttpsCompressionMode | ||
{ | ||
/// <summary> | ||
/// No value has been specified, use the configured defaults. | ||
Tratcher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/// </summary> | ||
Default = 0, | ||
|
||
/// <summary> | ||
/// Opts out of compression over HTTPS. Enabling compression on HTTPS requests for remotely manipulable content | ||
/// may expose security problems. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there any canonical or at least permanent place we could direct folks for more information? Do we have examples of other API ref docs that warn about potential security problems that we can follow form on? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
/// </summary> | ||
DoNotCompress, | ||
|
||
/// <summary> | ||
/// Opts into compression over HTTPS. Enabling compression on HTTPS requests for remotely manipulable content | ||
/// may expose security problems. | ||
/// </summary> | ||
Compress, | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
namespace Microsoft.AspNetCore.Http.Features | ||
{ | ||
/// <summary> | ||
/// Configures response compression behavior for HTTPS on a per-request basis. | ||
/// </summary> | ||
public interface IHttpsCompressionFeature | ||
{ | ||
/// <summary> | ||
/// The <see cref="HttpsCompressionMode"/> to use. | ||
/// </summary> | ||
HttpsCompressionMode Mode { get; set; } | ||
Tratcher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a "default" default? I'm not sure where I'd look to find the "configured defaults". Is the default hard-coded, or implied somewhere such that we could document it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I.e. the global value at ResponseCompressionOptions.EnableForHttps