avoiding 302 redirects