@@ -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 {
0 commit comments