From 81d39f19bcf541590427affcce0772470104bd77 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Tue, 10 Dec 2019 10:49:46 +0100 Subject: [PATCH] Handle relative URLs with empty path --- gold.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gold.go b/gold.go index 450d8ac..c17bf6c 100644 --- a/gold.go +++ b/gold.go @@ -163,7 +163,7 @@ func resolveRelativeURL(baseURL string, rel string) string { if u.IsAbs() { return rel } - if u.Path[0] == '/' { + if len(u.Path) > 0 && u.Path[0] == '/' { u.Path = u.Path[1:] }