mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 06:40:54 +03:00
telemetry server: add optional https and authentication
This commit is contained in:
@@ -46,10 +46,10 @@ func sendHTTPRequest(method, url string, body io.Reader, contentType string) (*h
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(contentType) > 0 {
|
||||
if contentType != "" {
|
||||
req.Header.Set("Content-Type", "application/json")
|
||||
}
|
||||
if len(authUsername) > 0 || len(authPassword) > 0 {
|
||||
if authUsername != "" || authPassword != "" {
|
||||
req.SetBasicAuth(authUsername, authPassword)
|
||||
}
|
||||
return httpclient.GetHTTPClient().Do(req)
|
||||
|
||||
Reference in New Issue
Block a user