mirror of
https://github.com/qdm12/ddns-updater.git
synced 2026-04-05 08:54:09 -04:00
Fixing #8 with base64 encoding of email:password for noip
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package update
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"encoding/xml"
|
||||
"fmt"
|
||||
@@ -423,7 +424,8 @@ func updateNoIP(httpClient *http.Client, hostname, email, password, ip string) (
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
r.Header.Set("Authorization", "Basic "+email+":"+password)
|
||||
credsEncoded := base64.StdEncoding.EncodeToString([]byte(email + ":" + password))
|
||||
r.Header.Set("Authorization", "Basic "+credsEncoded)
|
||||
r.Header.Set("User-Agent", "DDNS-Updater quentin.mcgaw@gmail.com")
|
||||
status, content, err := network.DoHTTPRequest(httpClient, r)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user