This commit is contained in:
2024-06-28 10:54:20 +03:00
parent 9a7a7b6f36
commit 8eeef825c0
7 changed files with 201 additions and 34 deletions

View File

@@ -54,7 +54,7 @@ func NewBVS(cfg config.BVSConfig) *BVSDecortClient {
},
},
},
cfg: cfg,
cfg: trimBVSConfig(&cfg),
mutex: &sync.Mutex{},
}
}
@@ -387,3 +387,9 @@ func (bdc *BVSDecortClient) do(req *http.Request, ctype string) ([]byte, error)
err = fmt.Errorf("%s", respBytes)
return nil, fmt.Errorf("could not execute request: %w", err)
}
func trimBVSConfig(cfg *config.BVSConfig) config.BVSConfig {
cfg.SSOURL = strings.TrimSuffix(cfg.SSOURL, "/")
cfg.DecortURL = strings.TrimSuffix(cfg.DecortURL, "/")
return *cfg
}