From 147b79eceba01d40bfa85240dcd1478dbf60b8d6 Mon Sep 17 00:00:00 2001 From: Ross Trottier Date: Thu, 27 Jun 2024 11:18:27 -0600 Subject: [PATCH] Fixed URL bug --- cmd/web/handlers.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/cmd/web/handlers.go b/cmd/web/handlers.go index 660bf74..78f5fb9 100644 --- a/cmd/web/handlers.go +++ b/cmd/web/handlers.go @@ -2,18 +2,10 @@ package main import ( "net/http" - "strings" ) func (app *application) home(writer http.ResponseWriter, request *http.Request) { - domain := request.Host - domainPieces := strings.Split(domain, ".") - var baseURI string - if len(domainPieces) > 1 { - baseURI = domainPieces[len(domainPieces) - 2] + domainPieces[len(domainPieces) - 1] - } else { - baseURI = domain - } + baseURI := request.Host data := templateData{ AppLinks: getAppLinks(app.tier, baseURI),