Skip to content

4.9Redirects

A redirect sends a visitor from one address to another, for example from http:// to https://. obsrvly follows up to 10 redirects. With more, the request fails with a message that contains stopped after 10 redirects.

  • Type redirect.count: how many redirects were followed. It is a number. With no redirect, it is 0.
  • Type redirect.final_url: the address where the redirects ended. It is text. With no redirect, it is the address you set.

Operators: eq, neq, gt, lt for the count. eq, neq, contains, matches for the final URL.

TypeOperatorValueWhat it means
redirect.final_urlcontainshttps://Visitors always end up on https.
redirect.final_urleqhttps://www.example.com/The bare domain lands on the www site.
redirect.countlt3No long chains of redirects.
redirect.counteq0The address answers directly.

When it fails: assertion redirect.count == 0: got 2, or assertion redirect.final_url contains "https://": got "http://example.com/". URLs in the message are cut to 80 characters.

Last updated