Skip to content

Commit

Permalink
Deprecates FilterContext.ResponseWriter() (#1802)
Browse files Browse the repository at this point in the history
Filter implementations should use `FilterContext.Request()` to modify
backend request and `FilterContext.Response()` to modify backend response.
`FilterContext.StateBag()` could be used to transfer state between request and response filter chain phases.
`FilterContext.Serve()` could be used to serve response from the request filter chain phase.

Signed-off-by: Alexander Yastrebov <[email protected]>
  • Loading branch information
AlexanderYastrebov authored Jun 29, 2021
1 parent 2a88786 commit f606f7a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions filters/filters.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const (
type FilterContext interface {
// The response writer object belonging to the incoming request. Used by
// filters that handle the requests themselves.
// Deprecated: use Response() or Serve()
ResponseWriter() http.ResponseWriter

// The incoming request object. It is forwarded to the route endpoint
Expand Down

0 comments on commit f606f7a

Please sign in to comment.