question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ignore OPTIONS request when using proxyandrecord

See original GitHub issue

I 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:closed
  • Created 6 months ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
StefHcommented, Mar 9, 2023

An official NuGet will be released in the next days.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found