Ignore OPTIONS request when using proxyandrecord
See original GitHub issueI am using wire mock as a standalone server, to record my web requests. Currently it is recording OPTIONS request as well when saving the mapping to the file .
Is there an extension I could use, so it does not save OPTIONS request, like how we are excluding specific headers not to save in mappings file
var url = "http://localhost:9095";
Console.WriteLine($"WireMock Recording on {url}");
var settings = new WireMockServerSettings
{
Urls = new[] { url },
StartAdminInterface = true,
ProxyAndRecordSettings = new ProxyAndRecordSettings
{
Url = "random url",
SaveMapping = true,
SaveMappingToFile = true,
SaveMappingForStatusCodePattern = "2xx,4xx",
ExcludedHeaders = new[]
{
"Postman-Token",
"Host",
"Authorization",
"User-Agent",
"Cache-Control"
}
}
};
var server = WireMockServer.Start(settings);
Issue Analytics
- State:
- Created 6 months ago
- Comments:10
Top Results From Across the Web
Why is an OPTIONS request sent and can I disable it?
Options request is a preflight request when you send (post) any data to another domain. It's a browser security issue. But we can...
Read more >Why is an OPTIONS request sent and can I disable it
Another way to disable OPTIONS requests is to use a web application firewall (WAF). A WAF is a security tool that filters and...
Read more >how remove options before post? · Issue #888 · axios/axios
The solution to prevent preflight request is to set the header Access-Control-Max-Age. The Access-Control-Max-Age response header indicates how ...
Read more >Why Is an OPTIONS Request Sent?
The OPTIONS request mentioned in the introduction is a preflight request, which is part of the CORS (Cross-Origin Resource Sharing).
Read more >Techniques for bypassing CORS Preflight Requests to ...
It typically functions by having the browser initiate a Preflight request (with the OPTIONS HTTP method) to the target origin.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

An official NuGet will be released in the next days.
https://github.com/WireMock-Net/WireMock.Net/pull/900