Cors and UseStaicFiles order /3 (#25490)
* Cors and UseStaicFiles order /3 * Cors and UseStaicFiles order /3 * Cors and UseStaicFiles order /3pull/25500/head
parent
2b9bdd4cf9
commit
07fec89d7e
|
@ -181,6 +181,10 @@ app.MapRazorPages();
|
|||
|
||||
For information about Single Page Applications, see the guides for the [React](xref:spa/react) and [Angular](xref:spa/angular) project templates.
|
||||
|
||||
## UseCors and UseStaticFiles order
|
||||
|
||||
The order for calling `UseCors` and `UseStaticFiles` depends on the app. For more information, see [UseCors and UseStaticFiles order](xref:security/cors#uc1)
|
||||
|
||||
### Forwarded Headers Middleware order
|
||||
|
||||
[!INCLUDE[](~/includes/ForwardedHeaders.md)]
|
||||
|
|
|
@ -90,6 +90,12 @@ The <xref:Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicyBuilder> methods ca
|
|||
|
||||
Note: The specified URL must **not** contain a trailing slash (`/`). If the URL terminates with `/`, the comparison returns `false` and no header is returned.
|
||||
|
||||
<a name="uc1"></a>
|
||||
|
||||
## UseCors and UseStaticFiles order
|
||||
|
||||
Typically, `UseStaticFiles` is called before `UseCors`. Apps that use JavaScript to retrieve static files cross site must call `UseCors` before `UseStaticFiles`.
|
||||
|
||||
<a name="dp"></a>
|
||||
|
||||
### CORS with default policy and middleware
|
||||
|
|
Loading…
Reference in New Issue