From 2b473a34c7496bdce340c543aaa66154111ea4d8 Mon Sep 17 00:00:00 2001 From: Valentin Kuznetsov Date: Wed, 7 Apr 2021 14:57:53 -0400 Subject: [PATCH] adjust usage of DBS_URL as base url --- services/helpers.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/services/helpers.go b/services/helpers.go index 7bdc9ff..4d2f7b7 100644 --- a/services/helpers.go +++ b/services/helpers.go @@ -26,10 +26,13 @@ func DBSUrl(inst string) string { if burl == "" { // case of dasgoclient burl = "https://cmsweb.cern.ch:8443" } - surl := fmt.Sprintf("%s/dbs/%s/DBSReader", burl, inst) if v != "" { - surl = v + if strings.Contains(v, "DBSReader") { + return v + } + burl = v } + surl := fmt.Sprintf("%s/dbs/%s/DBSReader", burl, inst) return surl } func PhedexUrl() string { @@ -38,10 +41,10 @@ func PhedexUrl() string { if burl == "" { // case of dasgoclient burl = "https://cmsweb.cern.ch:8443" } - surl := fmt.Sprintf("%s/phedex/datasvc/json/prod", burl) if v != "" { - surl = v + burl = v } + surl := fmt.Sprintf("%s/phedex/datasvc/json/prod", burl) return surl } func SitedbUrl() string {