🔨 Refactor URL handling logic and remove unused variables

This commit is contained in:
2024-03-07 15:32:38 +04:00
parent f7c4239163
commit a947b98acf
5 changed files with 16 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
package httpHandlers
import (
"github.com/aykhans/oh-my-url/app/config"
"net/http"
"strings"
)
@@ -12,7 +13,7 @@ func (hl *HandlerForward) UrlForward(w http.ResponseWriter, r *http.Request) {
http.NotFound(w, r)
return
} else if segments[1] == "" {
http.Redirect(w, r, hl.CreateDomain, http.StatusMovedPermanently)
http.Redirect(w, r, config.GetCreateDomain(), http.StatusMovedPermanently)
return
}