mps icon indicating copy to clipboard operation
mps copied to clipboard

HTTP Proxy TunnelHandler 使用 BasicAuth 中间件无效

Open shuqingzai opened this issue 1 year ago • 1 comments

  1. 在几个代理的 ServeHTTP 中运行中间件后,如果 err == nil ,不管 response 返回什么状态码都不会终止连接目标服务器 参考: https://github.com/telanflow/mps/blob/5a2b7e78662b34f43baa6ff9e46c2ed2624c8872/tunnel_handler.go#L50
  2. 在 BasicAuth 中间件中,如果验证不通过,会返回 statusCode = 407 但是由于 1 ,这个响应会被忽略,继续连接目标服务器 参考: https://github.com/telanflow/mps/blob/5a2b7e78662b34f43baa6ff9e46c2ed2624c8872/middleware/basicAuth.go#L22

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

shuqingzai avatar Aug 02 '24 09:08 shuqingzai

确实 这里的逻辑有问题

telanflow avatar Aug 13 '24 17:08 telanflow