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/gmi/gmi.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/gmi/gmi.go') diff --git a/src/gmi/gmi.go b/src/gmi/gmi.go index e37ca74..89c35bc 100644 --- a/src/gmi/gmi.go +++ b/src/gmi/gmi.go @@ -58,7 +58,9 @@ func (p *Params) SetupCfg(cfg *cfg.Cfg) { var err error - *publicURLStr = strings.TrimSuffix(*publicURLStr, "/") + if !strings.HasSuffix(*publicURLStr, "/") { + *publicURLStr += "/" + } if p.PublicURL, err = url.Parse(*publicURLStr); err != nil { return fmt.Errorf("parsing -gemini-public-url: %w", err) -- cgit v1.2.3