Skip to content

Commit cc39a81

Browse files
author
Trofimov Ivan Andreevich
committed
StyleCop fixes
1 parent 83d5629 commit cc39a81

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

src/System.Web.Http.Cors/CorsHttpConfigurationExtensions.cs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,35 @@ public static class CorsHttpConfigurationExtensions
2020
private const string CorsPolicyProviderFactoryKey = "MS_CorsPolicyProviderFactoryKey";
2121
private const string CorsEnabledKey = "MS_CorsEnabledKey";
2222

23+
/// <summary>
24+
/// Enables the support for CORS.
25+
/// </summary>
26+
/// <param name="httpConfiguration">The <see cref="HttpConfiguration"/>.</param>
27+
public static void EnableCors(this HttpConfiguration httpConfiguration)
28+
{
29+
EnableCors(httpConfiguration, null, false);
30+
}
31+
2332
/// <summary>
2433
/// Enables the support for CORS.
2534
/// </summary>
2635
/// <param name="httpConfiguration">The <see cref="HttpConfiguration"/>.</param>
2736
/// <param name="rethrowExceptions">Indicates whether upstream exceptions should be rethrown</param>
28-
public static void EnableCors(this HttpConfiguration httpConfiguration, bool rethrowExceptions = false)
37+
public static void EnableCors(this HttpConfiguration httpConfiguration, bool rethrowExceptions)
2938
{
3039
EnableCors(httpConfiguration, null, rethrowExceptions);
3140
}
3241

42+
/// <summary>
43+
/// Enables the support for CORS.
44+
/// </summary>
45+
/// <param name="httpConfiguration">The <see cref="HttpConfiguration"/>.</param>
46+
/// <param name="defaultPolicyProvider">The default <see cref="ICorsPolicyProvider"/>.</param>
47+
public static void EnableCors(this HttpConfiguration httpConfiguration, ICorsPolicyProvider defaultPolicyProvider)
48+
{
49+
EnableCors(httpConfiguration, defaultPolicyProvider, false);
50+
}
51+
3352
/// <summary>
3453
/// Enables the support for CORS.
3554
/// </summary>
@@ -38,7 +57,7 @@ public static void EnableCors(this HttpConfiguration httpConfiguration, bool ret
3857
/// <param name="rethrowExceptions">Indicates whether upstream exceptions should be rethrown</param>
3958
/// <exception cref="System.ArgumentNullException">httpConfiguration</exception>
4059
public static void EnableCors(this HttpConfiguration httpConfiguration, ICorsPolicyProvider defaultPolicyProvider,
41-
bool rethrowExceptions = false)
60+
bool rethrowExceptions)
4261
{
4362
if (httpConfiguration == null)
4463
{

src/System.Web.Http.Cors/CorsMessageHandler.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,22 @@ public class CorsMessageHandler : DelegatingHandler
2020
private HttpConfiguration _httpConfiguration;
2121
private bool _rethrowExceptions;
2222

23+
/// <summary>
24+
/// Initializes a new instance of the <see cref="CorsMessageHandler"/> class.
25+
/// </summary>
26+
/// <param name="httpConfiguration">The <see cref="HttpConfiguration"/>.</param>
27+
/// <exception cref="System.ArgumentNullException">httpConfiguration</exception>
28+
public CorsMessageHandler(HttpConfiguration httpConfiguration) : this(httpConfiguration, false)
29+
{
30+
}
31+
2332
/// <summary>
2433
/// Initializes a new instance of the <see cref="CorsMessageHandler"/> class.
2534
/// </summary>
2635
/// <param name="httpConfiguration">The <see cref="HttpConfiguration"/>.</param>
2736
/// <param name="rethrowExceptions">Indicates whether upstream exceptions should be rethrown</param>
2837
/// <exception cref="System.ArgumentNullException">httpConfiguration</exception>
29-
public CorsMessageHandler(HttpConfiguration httpConfiguration, bool rethrowExceptions = false)
38+
public CorsMessageHandler(HttpConfiguration httpConfiguration, bool rethrowExceptions)
3039
{
3140
if (httpConfiguration == null)
3241
{

0 commit comments

Comments
 (0)