aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorspacewander <[email protected]>2024-09-26 13:16:01 +0000
committerEdward Wang <[email protected]>2024-10-04 18:40:23 +0000
commitbe6dcdb7fc4ec160ad4d79329dc2eb561f909e72 (patch)
tree37a67f85722594a22d9e8214ca167daab219a8af
parent81189d41befe38ea7d50221876e39805cab3868d (diff)
downloadpingora-be6dcdb7fc4ec160ad4d79329dc2eb561f909e72.tar.gz
pingora-be6dcdb7fc4ec160ad4d79329dc2eb561f909e72.zip
document request_body_filterbleeper-yuchen-f03c6a3f42d
Includes-commit: cd6f77726b2a5ca57f885af360de2ad0de788e87 Replicated-from: https://github.com/cloudflare/pingora/pull/402 Signed-off-by: spacewander <[email protected]>
-rw-r--r--.bleep2
-rw-r--r--docs/user_guide/phase.md6
-rw-r--r--docs/user_guide/phase_chart.md3
3 files changed, 8 insertions, 3 deletions
diff --git a/.bleep b/.bleep
index da57c1f..d9ff5c9 100644
--- a/.bleep
+++ b/.bleep
@@ -1 +1 @@
-8e05a8f5b9d09885e6374011c422678043a2bda0 \ No newline at end of file
+9ec41e3e1817e36107195f6ca1a3168779857cc7 \ No newline at end of file
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");