You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following #387, Zimic will be able to reject requests both in local and remote interceptors.
Proposal
As an additional feature, we could support bypassing and rejecting requests in HTTP handlers. The configuration would be similar to onUnhandledRequest.
consthandler=interceptor.get('/users').respond({action: 'bypass'|'reject'})// remote interceptor can only reject
consthandler=interceptor.get('/users').respond((request)=>{// ...return{action: 'bypass'|'reject'}// remote interceptor can only reject})
Related
We already have a method handler.bypass() that clears the response of a handler, essentially skipping it when searching for a matched handler. Re-using the same term may cause confusion. I believe we could rename handler.bypass() to handler.skip()/handler.unskip() or handler.clearResponse().
The text was updated successfully, but these errors were encountered:
diego-aquino
changed the title
Support rejecting requests in HTTP handlers
Support bypassing and rejecting requests matched by HTTP handlers
Sep 2, 2024
Following #387, Zimic will be able to reject requests both in local and remote interceptors.
Proposal
As an additional feature, we could support bypassing and rejecting requests in HTTP handlers. The configuration would be similar to
onUnhandledRequest
.Related
We already have a method
handler.bypass()
that clears the response of a handler, essentially skipping it when searching for a matched handler. Re-using the same term may cause confusion. I believe we could renamehandler.bypass()
tohandler.skip()
/handler.unskip()
orhandler.clearResponse()
.The text was updated successfully, but these errors were encountered: