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.
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 (
OPTIONSmethod), but are missing CORS headers on the actualPOSTorGETerror response. For now I've simply added ato
function rewriteResponseHeader(e)locally, and loaded the add-on viaabout:debugging, which works just fine for this specific case.