public function isRedirect(string $location = null): bool
    {
        return \in_array(
                $this->statusCode,
                [
                    StatusCode::CREATED,
                    StatusCode::MOVED_PERMANENTLY,
                    StatusCode::FOUND,
                    StatusCode::SEE_OTHER,
                    StatusCode::TEMPORARY_REDIRECT,
                    StatusCode::PERMANENT_REDIRECT,
                ],
                true
            )
            && (null === $location
                ?: $location === $this->headers->get('Location'));
    }