all repos — website @ 48c986422c8f6f08a36f1a801b7521daec787b26

My website

fix crash when overriding BASE_URL
Alan Pearce alan@alanpearce.eu
Sun, 21 Apr 2024 22:22:24 +0200
commit

48c986422c8f6f08a36f1a801b7521daec787b26

parent

221404cf6277a9696ccd1b95f0ab8be0f0720845

1 files changed, 4 insertions(+), 1 deletions(-)

jump to
M cmd/build/build.gocmd/build/build.go
@@ -566,7 +566,10 @@ if err != nil { 		log.Panic(errors.Errorf("could not get config: %v", err))
 	}
 
-	config.BaseURL = ioConfig.BaseURL
+	config.BaseURL.URL, err = url.Parse(ioConfig.BaseURL.String())
+	if err != nil {
+		log.Panic(errors.Errorf("highly unlikely: %v", err))
+	}
 
 	err = os.RemoveAll(ioConfig.Destination)
 	if err != nil {