diff options
author | spacewander <[email protected]> | 2024-09-26 13:16:01 +0000 |
---|---|---|
committer | Yuchen Wu <[email protected]> | 2024-10-11 16:52:23 -0700 |
commit | 9921fe422274ced5ef14eb582d63529859fed441 (patch) | |
tree | 37a67f85722594a22d9e8214ca167daab219a8af /docs | |
parent | 894ca2dd64526c49a9adc43aa45a0a0f32743987 (diff) | |
download | pingora-9921fe422274ced5ef14eb582d63529859fed441.tar.gz pingora-9921fe422274ced5ef14eb582d63529859fed441.zip |
document request_body_filter
Includes-commit: cd6f77726b2a5ca57f885af360de2ad0de788e87
Replicated-from: https://github.com/cloudflare/pingora/pull/402
Signed-off-by: spacewander <[email protected]>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/user_guide/phase.md | 6 | ||||
-rw-r--r-- | docs/user_guide/phase_chart.md | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/docs/user_guide/phase.md b/docs/user_guide/phase.md index 46e9b5d..4e520c7 100644 --- a/docs/user_guide/phase.md +++ b/docs/user_guide/phase.md @@ -26,7 +26,8 @@ Pingora-proxy allows users to insert arbitrary logic into the life of a request. Connect--connection failure-->fail_to_connect; connected_to_upstream-->upstream_request_filter; - upstream_request_filter --> SendReq{{IO: send request to upstream}}; + upstream_request_filter --> request_body_filter; + request_body_filter --> SendReq{{IO: send request to upstream}}; SendReq-->RecvResp{{IO: read response from upstream}}; RecvResp-->upstream_response_filter-->response_filter-->upstream_response_body_filter-->response_body_filter-->logging-->endreq("request done"); @@ -61,6 +62,9 @@ This function is similar to `request_filter()` but executes before any other log ### `request_filter()` This phase is usually for validating request inputs, rate limiting, and initializing context. +### `request_body_filter()` +This phase is triggered after a response body is ready to send to upstream. It will be called every time a piece of request body is received. + ### `proxy_upstream_filter()` This phase determines if we should continue to the upstream to serve a response. If we short-circuit, a 502 is returned by default, but a different response can be implemented. diff --git a/docs/user_guide/phase_chart.md b/docs/user_guide/phase_chart.md index a6b6a4e..9498872 100644 --- a/docs/user_guide/phase_chart.md +++ b/docs/user_guide/phase_chart.md @@ -11,7 +11,8 @@ Pingora proxy phases without caching Connect--connection failure-->fail_to_connect; connected_to_upstream-->upstream_request_filter; - upstream_request_filter --> SendReq{{IO: send request to upstream}}; + upstream_request_filter --> request_body_filter; + request_body_filter --> SendReq{{IO: send request to upstream}}; SendReq-->RecvResp{{IO: read response from upstream}}; RecvResp-->upstream_response_filter-->response_filter-->upstream_response_body_filter-->response_body_filter-->logging-->endreq("request done"); |