From c5cdeec121e421ddfe42841ac74d58b91ef6f408 Mon Sep 17 00:00:00 2001 From: "taekyu.kang" Date: Thu, 8 Feb 2024 10:56:28 +0900 Subject: [PATCH] trivial. minor fix --- cmd/server/main.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmd/server/main.go b/cmd/server/main.go index e07e43d1..13d060cf 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -5,6 +5,7 @@ import ( "fmt" "net/http" "strconv" + "strings" "github.com/spf13/pflag" "github.com/spf13/viper" @@ -74,7 +75,13 @@ func init() { log.Error(err) } - swagger.SwaggerInfo.Host = viper.GetString("external-address") + address := viper.GetString("external-address") + arr := strings.Split(address, "//") + if len(arr) >= 2 { + address = arr[1] + } + + swagger.SwaggerInfo.Host = address } // @title tks-api service