mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-20 07:51:41 +02: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
|
# 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#
|
``` c#
|
||||||
var settings = new WireMockServerSettings
|
var settings = new WireMockServerSettings
|
||||||
|
|||||||
Reference in New Issue
Block a user