From 18881651081aa5d0ce0965534c1db930288f69a6 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 20 Jul 2022 09:32:10 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20User=20Agent=20=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/conf.go | 1 - kernel/util/working.go | 4 +++- kernel/util/working_mobile.go | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/kernel/model/conf.go b/kernel/model/conf.go index a3125c13b..324282ef4 100644 --- a/kernel/model/conf.go +++ b/kernel/model/conf.go @@ -219,7 +219,6 @@ func InitConf() { Conf.System.WorkspaceDir = util.WorkspaceDir Conf.System.DataDir = util.DataDir Conf.System.Container = util.Container - util.UserAgent = util.UserAgent + " " + util.Container Conf.System.OS = runtime.GOOS Conf.Newbie = util.IsNewbie diff --git a/kernel/util/working.go b/kernel/util/working.go index 055b329e0..04719af30 100644 --- a/kernel/util/working.go +++ b/kernel/util/working.go @@ -55,7 +55,6 @@ 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") @@ -84,6 +83,9 @@ func Boot() { Container = "docker" } + UserAgent = UserAgent + " " + Container + httpclient.SetUserAgent(UserAgent) + initWorkspaceDir(*workspacePath) SSL = *ssl diff --git a/kernel/util/working_mobile.go b/kernel/util/working_mobile.go index 0b5144763..94cd8c8f4 100644 --- a/kernel/util/working_mobile.go +++ b/kernel/util/working_mobile.go @@ -32,7 +32,6 @@ func BootMobile(container, appDir, workspaceDir, nativeLibDir, privateDataDir, l IncBootProgress(3, "Booting...") rand.Seed(time.Now().UTC().UnixNano()) initMime() - httpclient.SetUserAgent(UserAgent) HomeDir = filepath.Join(workspaceDir, "home") userHomeConfDir := filepath.Join(HomeDir, ".config", "siyuan") @@ -61,6 +60,8 @@ func BootMobile(container, appDir, workspaceDir, nativeLibDir, privateDataDir, l IconsPath = filepath.Join(AppearancePath, "icons") Resident = true Container = container + UserAgent = UserAgent + " " + Container + httpclient.SetUserAgent(UserAgent) Lang = lang initPathDir() bootBanner := figure.NewFigure("SiYuan", "", true)