cloudflare/pingora

Is there a way to skip proxy to upstream once there is an error in `request_body_filter`

Closed this issue · 5 comments

I have a question regarding skipping proxying to upstream in case of errors.

Currently, I know that it’s possible to skip proxying with the help of proxy_upstream_filter from request_filter. However, I couldn’t find any way to achieve similar behavior from request_body_filter

Behavior observed:

  • When request_body_filter encounters an error, the downstream correctly receives an error response.
  • But the upstream still receives the request — only with an empty body.

Desired behavior:

  • It would be better if, once an error occurs in request_body_filter, the request is not sent to the upstream at all.

Is there a recommended way to do this, or is it currently not supported?

Thanks!

Hey @andrewhavck

any update on this ?

This is not currently supported mainly because the request_body_filter and general body proxying only runs after upstream_request_filter. Other folks have been interested in a mode where the body is read, buffered, and filtered upfront which would be a great improvement we are open to (as an opt-in per-session setting).

This feature would definitely be great to have.
Do you have any plans or timeline in mind for when it might be implemented?

This question has been stale for a week. It will be closed in an additional day if not updated.

This issue has been closed because it has been stalled with no activity.