Skip to main content

assert_http_redirect_rejected

Function assert_http_redirect_rejected 

Source
pub async fn assert_http_redirect_rejected<F, Fut>(send: F)
where F: FnOnce(String) -> Fut, Fut: Future<Output = u16>,
Expand description

Asserts that a GET request returns the original 307 without contacting its redirect target.

send receives a loopback URL and returns the response status code. It must issue one GET request through the client under test without overriding the client’s redirect policy.

§Panics

Panics if:

  • Binding a listener or reading its local address fails.
  • send panics or takes more than five seconds.
  • The response status is not 307 or the destination receives a request.