diff options
Diffstat (limited to 'views.go')
-rw-r--r-- | views.go | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -25,6 +25,10 @@ func Views() *views { func (v *views) Index() http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + if req.URL.Path != "/" { + http.NotFound(w, req) + return + } if _, ok := req.Context().Value("user").(*User); ok { err := v.templates["index"].ExecuteTemplate(w, "base", NewPageCtx(req)) if err != nil { @@ -102,6 +106,7 @@ func NewPageCtx(req *http.Request) PageCtx { "FlashClass": flash_class, "User": user, "CsrfField": csrf.TemplateField(req), + "BasePath": pwman.BasePath, } } |