docs(middleware): comments to function `BasicAuthForProxy` (#3881)

This commit is contained in:
Endless Paradox 2024-03-12 13:51:04 +08:00 committed by GitHub
parent f70dd00b00
commit 861ffb9181
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -91,6 +91,7 @@ func authorizationHeader(user, password string) string {
return "Basic " + base64.StdEncoding.EncodeToString(bytesconv.StringToBytes(base)) return "Basic " + base64.StdEncoding.EncodeToString(bytesconv.StringToBytes(base))
} }
// BasicAuthForProxy returns a Basic HTTP Proxy-Authorization middleware.
func BasicAuthForProxy(accounts Accounts, realm string) HandlerFunc { func BasicAuthForProxy(accounts Accounts, realm string) HandlerFunc {
if realm == "" { if realm == "" {
realm = "Proxy Authorization Required" realm = "Proxy Authorization Required"