mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-17 12:38:07 +01:00
🐛 S3/WebDAV 数据同步无法使用代理 Fix https://github.com/siyuan-note/siyuan/issues/6695
This commit is contained in:
parent
255a9c1e01
commit
f38e053702
2 changed files with 27 additions and 3 deletions
|
|
@ -20,7 +20,6 @@ import (
|
|||
"bytes"
|
||||
"crypto/rand"
|
||||
"crypto/sha256"
|
||||
"crypto/tls"
|
||||
"encoding/base64"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
|
@ -824,7 +823,7 @@ func newRepository() (ret *dejavu.Repo, err error) {
|
|||
case conf.ProviderSiYuan:
|
||||
cloudRepo = cloud.NewSiYuan(&cloud.BaseCloud{Conf: cloudConf})
|
||||
case conf.ProviderS3:
|
||||
s3HTTPClient := &http.Client{Transport: &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: cloudConf.S3.SkipTlsVerify}}}
|
||||
s3HTTPClient := &http.Client{Transport: util.NewTransport(cloudConf.S3.SkipTlsVerify)}
|
||||
s3HTTPClient.Timeout = 30 * time.Second
|
||||
cloudRepo = cloud.NewS3(&cloud.BaseCloud{Conf: cloudConf}, s3HTTPClient)
|
||||
case conf.ProviderWebDAV:
|
||||
|
|
@ -834,7 +833,7 @@ func newRepository() (ret *dejavu.Repo, err error) {
|
|||
webdavClient.SetHeader("Authorization", auth)
|
||||
webdavClient.SetHeader("User-Agent", util.UserAgent)
|
||||
webdavClient.SetTimeout(30 * time.Second)
|
||||
webdavClient.SetTransport(&http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: cloudConf.WebDAV.SkipTlsVerify}})
|
||||
webdavClient.SetTransport(util.NewTransport(cloudConf.WebDAV.SkipTlsVerify))
|
||||
cloudRepo = cloud.NewWebDAV(&cloud.BaseCloud{Conf: cloudConf}, webdavClient)
|
||||
default:
|
||||
err = fmt.Errorf("unknown cloud provider [%d]", Conf.Sync.Provider)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue