File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,11 @@ public long? PreflightMaxAge
85
85
/// </summary>
86
86
public bool SupportsCredentials { get ; set ; }
87
87
88
+ /// <summary>
89
+ /// Gets or sets a value indicating whether upstream exceptions should be rethrown.
90
+ /// </summary>
91
+ public bool RethrowExceptions { get ; set ; }
92
+
88
93
/// <summary>
89
94
/// Returns a <see cref="System.String" /> that represents this instance.
90
95
/// </summary>
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ protected async override Task<HttpResponseMessage> SendAsync(HttpRequestMessage
47
47
CorsRequestContext corsRequestContext = request . GetCorsRequestContext ( ) ;
48
48
if ( corsRequestContext != null )
49
49
{
50
+ CorsPolicy corsPolicy = await GetCorsPolicyAsync ( request , cancellationToken ) ;
50
51
try
51
52
{
52
53
if ( corsRequestContext . IsPreflight )
@@ -60,6 +61,9 @@ protected async override Task<HttpResponseMessage> SendAsync(HttpRequestMessage
60
61
}
61
62
catch ( Exception exception )
62
63
{
64
+ if ( corsPolicy . RethrowExceptions )
65
+ throw ;
66
+
63
67
return HandleException ( request , exception ) ;
64
68
}
65
69
}
You can’t perform that action at this time.
0 commit comments