mirror of
https://github.com/rjNemo/rentease.git
synced 2026-06-12 13:46:51 +00:00
Revert "deactivate TLS check for client call"
This reverts commit 8acffdf9b2.
This commit is contained in:
parent
43af5f1a76
commit
441806bb4f
1 changed files with 3 additions and 7 deletions
|
|
@ -2,7 +2,6 @@ package pdf
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"crypto/tls"
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
|
|
@ -130,20 +129,17 @@ func (ps PdfService) BuildReport(r *booking.Report, period string, month, year i
|
||||||
func (ps PdfService) sendData(payload []byte) error {
|
func (ps PdfService) sendData(payload []byte) error {
|
||||||
req, err := http.NewRequest("POST", ps.url, bytes.NewBuffer(payload))
|
req, err := http.NewRequest("POST", ps.url, bytes.NewBuffer(payload))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warnf("Error creating request: %s", err)
|
log.Warnf("Error creating request:", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
req.Header.Set("Authorization", "Bearer "+ps.apiKey)
|
req.Header.Set("Authorization", "Bearer "+ps.apiKey)
|
||||||
req.Header.Set("Content-Type", "application/json")
|
req.Header.Set("Content-Type", "application/json")
|
||||||
|
|
||||||
t := &http.Transport{
|
client := &http.Client{}
|
||||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
|
||||||
}
|
|
||||||
client := &http.Client{Transport: t}
|
|
||||||
resp, err := client.Do(req)
|
resp, err := client.Do(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warnf("Error sending request: %s", err)
|
log.Warnf("Error sending request:", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue