Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter by HTTP method #64

Open
johannespfrang opened this issue Oct 21, 2024 · 0 comments
Open

Filter by HTTP method #64

johannespfrang opened this issue Oct 21, 2024 · 0 comments

Comments

@johannespfrang
Copy link

It would be useful to be able to filter not only by URL, but also by HTTP request method.

My specific use case is simulating intermittent error responses which succeed a CORS pre-flight check (OPTIONS method), but are missing CORS headers on the actual POST or GET error response. For now I've simply added a

    if (`${e.method}`.toUpperCase() === "OPTIONS") {
        // keep CORS pre-flight responses intact
        log("leaving cors preflight intact")
        return {responseHeaders: e.responseHeaders};
    }

to function rewriteResponseHeader(e) locally, and loaded the add-on via about:debugging, which works just fine for this specific case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant