Skip to content

HTTP对于服务器指定的302跳转处理的问题 #164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
aovpha opened this issue Dec 6, 2020 · 1 comment
Open

HTTP对于服务器指定的302跳转处理的问题 #164

aovpha opened this issue Dec 6, 2020 · 1 comment

Comments

@aovpha
Copy link

aovpha commented Dec 6, 2020

目前情况是这样的:
我正在使用Anagular 10(其中HTTP模块使用的是rxjs组件)搭建登陆模块,使用response的返回结果和json的发送方式,如果不添加httpheader的情况下,http异常可以正常拦截到未登录的302跳转后地址的401错误返回,目前http头信息中需要添加一部分信息,这个时候,http错误模块就无法正常获取到302跳转完成以后的结果,而是直接拦截本次请求的302处理结果(这个时候http的返回状态全部丢失,变成了一次ErrorEvent),后续浏览器又会再发两次跳转后地址的请求,这两部分错误就无法正常捕获到结果,而且返回结果也变成了403和直接的访问错误,请问有没有人解决过类似的问题,修改请求头,就可以直接改变http的调用处理流程?

@asnowwolf
Copy link
Contributor

按常理来说 30x 系列的错误码是不会被 ajax 处理的,所以问题应该在别的地方。你可以看看网络记录和调用栈,仔细分析一下。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants