Skip to main content

sanitize_hop_by_hop_response

Function sanitize_hop_by_hop_response 

pub fn sanitize_hop_by_hop_response<B>(
    response: &mut Response<B>,
    request_context: &HopByHopHeaderContext,
)
Available on crate features http and std only.
Expand description

Sanitize a response for forwarding to the next hop.

An invalid or uncorrelated protocol upgrade is replaced with a 502 Bad Gateway response. HTTP/1.1 responses also instruct the next hop to close, because forwarding a stripped 101 Switching Protocols response would desynchronize the connection.