♻️ 内核中的 HTTP 客户端拆分项目 https://github.com/siyuan-note/siyuan/issues/5269

This commit is contained in:
Liang Ding 2022-06-23 01:22:28 +08:00
parent 25ddad5957
commit 779e4fc4ae
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
13 changed files with 59 additions and 150 deletions

View file

@ -32,6 +32,7 @@ import (
"github.com/88250/gulu"
figure "github.com/common-nighthawk/go-figure"
goPS "github.com/mitchellh/go-ps"
"github.com/siyuan-note/httpclient"
)
//var Mode = "dev"
@ -53,6 +54,7 @@ func Boot() {
IncBootProgress(3, "Booting...")
rand.Seed(time.Now().UTC().UnixNano())
initMime()
httpclient.SetUserAgent(UserAgent)
workspacePath := flag.String("workspace", "", "dir path of the workspace, default to ~/Documents/SiYuan/")
wdPath := flag.String("wd", WorkingDir, "working directory of SiYuan")
@ -323,7 +325,7 @@ func checkPort() {
LogInfof("port [%s] is opened, try to check version of running kernel", ServerPort)
result := NewResult()
_, err := NewBrowserRequest("").
_, err := httpclient.NewBrowserRequest("").
SetResult(result).
SetHeader("User-Agent", UserAgent).
Get("http://127.0.0.1:" + ServerPort + "/api/system/version")