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
8585 /// </summary>
8686 public bool SupportsCredentials { get ; set ; }
8787
88+ /// <summary>
89+ /// Gets or sets a value indicating whether upstream exceptions should be rethrown.
90+ /// </summary>
91+ public bool RethrowExceptions { get ; set ; }
92+
8893 /// <summary>
8994 /// Returns a <see cref="System.String" /> that represents this instance.
9095 /// </summary>
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ protected async override Task<HttpResponseMessage> SendAsync(HttpRequestMessage
4747 CorsRequestContext corsRequestContext = request . GetCorsRequestContext ( ) ;
4848 if ( corsRequestContext != null )
4949 {
50+ CorsPolicy corsPolicy = await GetCorsPolicyAsync ( request , cancellationToken ) ;
5051 try
5152 {
5253 if ( corsRequestContext . IsPreflight )
@@ -60,6 +61,9 @@ protected async override Task<HttpResponseMessage> SendAsync(HttpRequestMessage
6061 }
6162 catch ( Exception exception )
6263 {
64+ if ( corsPolicy . RethrowExceptions )
65+ throw ;
66+
6367 return HandleException ( request , exception ) ;
6468 }
6569 }
You can’t perform that action at this time.
0 commit comments