diff --git a/controllers/CreateWebPageController.go b/controllers/CreateWebPageController.go index 41da4da..20b15a4 100755 --- a/controllers/CreateWebPageController.go +++ b/controllers/CreateWebPageController.go @@ -4,6 +4,7 @@ import ( "ch/kirari04/videocms/helpers" "ch/kirari04/videocms/inits" "ch/kirari04/videocms/models" + "fmt" "log" "net/http" @@ -28,6 +29,10 @@ func CreateWebPage(c echo.Context) error { return c.String(http.StatusBadRequest, "Path already used") } + if validatus.Path[len(validatus.Path)-1] != '/' { + validatus.Path = fmt.Sprintf("%s/", validatus.Path) + } + webPage := models.WebPage{ Path: validatus.Path, Title: validatus.Title,