Skip to content
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

HTTP Proxy TunnelHandler 使用 BasicAuth 中间件无效 #13

Open
shuqingzai opened this issue Aug 2, 2024 · 1 comment
Open

HTTP Proxy TunnelHandler 使用 BasicAuth 中间件无效 #13

shuqingzai opened this issue Aug 2, 2024 · 1 comment

Comments

@shuqingzai
Copy link

shuqingzai commented Aug 2, 2024

  1. 在几个代理的 ServeHTTP 中运行中间件后,如果 err == nil ,不管 response 返回什么状态码都不会终止连接目标服务器
    参考:
    if err != nil && err != MethodNotSupportErr {
  2. 在 BasicAuth 中间件中,如果验证不通过,会返回 statusCode = 407 但是由于 1 ,这个响应会被忽略,继续连接目标服务器
    参考:
    return BasicUnauthorized(req, realm), nil

是我用的方法不对吗?还是说这里逻辑有问题??

@telanflow
Copy link
Owner

确实 这里的逻辑有问题

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