@@ -20,16 +20,35 @@ public static class CorsHttpConfigurationExtensions
20
20
private const string CorsPolicyProviderFactoryKey = "MS_CorsPolicyProviderFactoryKey" ;
21
21
private const string CorsEnabledKey = "MS_CorsEnabledKey" ;
22
22
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
+
23
32
/// <summary>
24
33
/// Enables the support for CORS.
25
34
/// </summary>
26
35
/// <param name="httpConfiguration">The <see cref="HttpConfiguration"/>.</param>
27
36
/// <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 )
29
38
{
30
39
EnableCors ( httpConfiguration , null , rethrowExceptions ) ;
31
40
}
32
41
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
+
33
52
/// <summary>
34
53
/// Enables the support for CORS.
35
54
/// </summary>
@@ -38,7 +57,7 @@ public static void EnableCors(this HttpConfiguration httpConfiguration, bool ret
38
57
/// <param name="rethrowExceptions">Indicates whether upstream exceptions should be rethrown</param>
39
58
/// <exception cref="System.ArgumentNullException">httpConfiguration</exception>
40
59
public static void EnableCors ( this HttpConfiguration httpConfiguration , ICorsPolicyProvider defaultPolicyProvider ,
41
- bool rethrowExceptions = false )
60
+ bool rethrowExceptions )
42
61
{
43
62
if ( httpConfiguration == null )
44
63
{
0 commit comments