optimize the code of the command line (#3614)

This commit is contained in:
fatedier
2023-09-15 10:33:32 +08:00
committed by GitHub
parent 74255f711e
commit bae0b4d7c0
41 changed files with 566 additions and 1363 deletions

View File

@@ -95,3 +95,8 @@ func ParseBasicAuth(auth string) (username, password string, ok bool) {
}
return cs[:s], cs[s+1:], true
}
func BasicAuth(username, passwd string) string {
auth := username + ":" + passwd
return "Basic " + base64.StdEncoding.EncodeToString([]byte(auth))
}