Skip to content

Commit a44926b

Browse files
committed
Document new beforeResponse parameter
1 parent 284b130 commit a44926b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/rules/requests/request-handler-definitions.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,10 +550,12 @@ export interface PassThroughHandlerOptions extends PassThroughHandlerConnectionO
550550
/**
551551
* A callback that will be passed the full response before it is passed through,
552552
* and which returns a value that defines how the the response content should
553-
* be transformed before it's returned to the client.
553+
* be transformed before it's returned to the client. The callback is also passed
554+
* the request that was sent to the server (as a 2nd parameter) for reference.
554555
*
555556
* The callback can either return an object to define how the response should be
556-
* changed, or the string 'close' to immediately close the underlying connection.
557+
* changed, or the strings 'close' or 'reset' to immediately close/reset the
558+
* underlying connection.
557559
*
558560
* All fields on the object are optional, and returning undefined is equivalent
559561
* to returning an empty object (transforming nothing).

0 commit comments

Comments
 (0)