mirror of
https://github.com/binwiederhier/ntfy.git
synced 2025-05-30 10:25:40 +02:00
More docs docs docs
This commit is contained in:
parent
c3a2331b59
commit
1552d8103e
7 changed files with 211 additions and 121 deletions
util
|
@ -1,6 +1,7 @@
|
|||
package util
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/gabriel-vasile/mimetype"
|
||||
|
@ -240,3 +241,8 @@ func ReadPassword(in io.Reader) ([]byte, error) {
|
|||
|
||||
return password, nil
|
||||
}
|
||||
|
||||
// BasicAuth encodes the Authorization header value for basic auth
|
||||
func BasicAuth(user, pass string) string {
|
||||
return fmt.Sprintf("Basic %s", base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%s:%s", user, pass))))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue