add HTTP plugin

This commit is contained in:
ginuerzh
2023-09-20 22:56:43 +08:00
parent afddd2d29e
commit 1760151500
29 changed files with 1032 additions and 147 deletions

View File

@ -206,7 +206,7 @@ func (h *forwardHandler) handleHTTP(ctx context.Context, rw io.ReadWriter, log l
if auther := target.Options().Auther; auther != nil {
username, password, _ := req.BasicAuth()
ok, id := auther.Authenticate(ctx, username, password)
id, ok := auther.Authenticate(ctx, username, password)
if !ok {
resp.StatusCode = http.StatusUnauthorized
resp.Header.Set("WWW-Authenticate", "Basic")