Skip to content

Commit ee70b30

Browse files
docs: Add document to constant AuthProxyUserKey and BasicAuthForProxy. (#3887)
1 parent 990c44a commit ee70b30

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

auth.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import (
1515

1616
// AuthUserKey is the cookie name for user credential in basic auth.
1717
const AuthUserKey = "user"
18+
19+
// AuthProxyUserKey is the cookie name for proxy_user credential in basic auth for proxy.
1820
const AuthProxyUserKey = "proxy_user"
1921

2022
// Accounts defines a key/value for user/pass list of authorized logins.
@@ -92,6 +94,7 @@ func authorizationHeader(user, password string) string {
9294
}
9395

9496
// BasicAuthForProxy returns a Basic HTTP Proxy-Authorization middleware.
97+
// If the realm is empty, "Proxy Authorization Required" will be used by default.
9598
func BasicAuthForProxy(accounts Accounts, realm string) HandlerFunc {
9699
if realm == "" {
97100
realm = "Proxy Authorization Required"

0 commit comments

Comments
 (0)