From 0665d0c65974533fbd313f4e0b062b5103057aeb Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Sat, 18 May 2024 18:29:19 +0200 Subject: Replace all URL rendering within templates by a URLConstructor --- src/http/http.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/http/http.go') diff --git a/src/http/http.go b/src/http/http.go index 9bfed59..93cc043 100644 --- a/src/http/http.go +++ b/src/http/http.go @@ -89,7 +89,10 @@ func (p *Params) SetupCfg(cfg *cfg.Cfg) { return fmt.Errorf("unmarshaling -http-auth-ratelimit: %w", err) } - *publicURLStr = strings.TrimSuffix(*publicURLStr, "/") + if !strings.HasSuffix(*publicURLStr, "/") { + *publicURLStr += "/" + } + if p.PublicURL, err = url.Parse(*publicURLStr); err != nil { return fmt.Errorf("parsing -http-public-url: %w", err) } -- cgit v1.2.3