开发者

Http Headers: Redirected because not allowed?

开发者 https://www.devze.com 2023-01-30 12:03 出处:网络
What\'s the correct header to say \'you are not authenticated/authoriz开发者_StackOverflowed to access the content of this URL, so I\'m redirecting you somewhere else (eg: login page)\'.

What's the correct header to say 'you are not authenticated/authoriz开发者_StackOverflowed to access the content of this URL, so I'm redirecting you somewhere else (eg: login page)'.

Is it fine to just use a 302 ? Or maybe a 307 ?


401 is unauthorized, there is no unauthorized and redirection (301/307) in the same HTTP status.


I'd issue a 401 with a link in the body and a timed javascript redirect.

0

精彩评论

暂无评论...
验证码 换一张
取 消