mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-20 16:23:42 +01:00
Updated Cors (markdown)
16
Cors.md
16
Cors.md
@@ -8,7 +8,21 @@ The Same Origin Policy disallows reading the remote resource at http://localhost
|
||||
```
|
||||
|
||||
# Solution
|
||||
Cors support is not enabled by default, you can enable it yourself when configuring WireMock.Net Server, like:
|
||||
Cors support is not enabled by default, you can enable it when configuring WireMock.Net Server.
|
||||
|
||||
|
||||
## Option 1
|
||||
|
||||
``` c#
|
||||
var settings = new WireMockServerSettings
|
||||
{
|
||||
CorsPolicyOptions = CorsPolicyOptions.AllowAll
|
||||
};
|
||||
|
||||
Note that these options are only available when running in .NET Core (3.1, 5.0 or higher)
|
||||
|
||||
## Option 2
|
||||
Configure it manually:
|
||||
|
||||
``` c#
|
||||
var settings = new WireMockServerSettings
|
||||
|
||||
Reference in New Issue
Block a user