Skip to content

Document redirects from request_filter - #957

Open
ting-hong-shieh wants to merge 1 commit into
cloudflare:mainfrom
ting-hong-shieh:docs/request-filter-redirect
Open

Document redirects from request_filter#957
ting-hong-shieh wants to merge 1 commit into
cloudflare:mainfrom
ting-hong-shieh:docs/request-filter-redirect

Conversation

@ting-hong-shieh

Copy link
Copy Markdown

Closes #498.

This revisits the documentation change proposed in #613 on current main and adds a runnable example.

Summary

  • Clarify that returning Ok(true) and setting end_of_stream do not add HTTP message framing.
  • Show a bodyless 302 response with Content-Length: 0 in the user guide.
  • Add the same redirect path to the compiled gateway example, including a curl command.
  • Document session.set_keepalive(None) as the alternative when the connection should close.

Testing

  • cargo fmt --all -- --check
  • cargo check -p pingora-proxy --example gateway
  • cargo +1.85.0 check -p pingora-proxy --example gateway
  • cargo test -p pingora-proxy --doc
  • cargo clippy -p pingora-proxy --example gateway -- -D warnings
  • RUSTDOCFLAGS='-D rustdoc::broken_intra_doc_links' cargo doc -p pingora-proxy --no-deps
  • Ran the gateway example and requested /redirect over HTTP/1.1. Curl completed immediately with 302 Found, Location: /family/, Content-Length: 0, and an empty body while keeping the connection reusable.

@ting-hong-shieh
ting-hong-shieh marked this pull request as ready for review August 13, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When I attempt to issue an HTTP Redirect from request_filter the connection hangs

1 participant