Skip to main content

forward_to

Function forward_to 

pub fn forward_to<B, P>(
    supports_early_data: P,
) -> ValidateRequestHeaderLayer<impl ValidateRequest<B, ResponseBody = Body> + Clone>
where B: Send + Sync + 'static, P: Fn(&Request<B>) -> bool + Clone + Send + Sync + 'static,
Available on crate features http and std only.
Expand description

Forward only according to the selected origin’s early-data capability.

The predicate must mean the origin understands Early-Data and correctly returns 425 for requests it cannot safely process. It is not permission to replay arbitrary methods or payloads. The existing client retry policy still controls upstream early sending.

Inherited exposure cannot be cleared by waiting on this hop: an incapable origin produces 425 without being called. Actual current-hop-only receipt waits for confirmation and forwards unmarked with upstream early data forbidden. A capable origin receives the marker while confirmation is pending; an already-confirmed current hop stays unmarked and forbids upstream early sending. Its 425 must pass back unchanged. Confirmed unmarked ingress stays unmarked. Apply this after routing chooses the origin and before sending upstream.