From 4c653fea369077a29c866ae1c5c3c89934480705 Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Fri, 12 Feb 2021 12:52:08 +0000 Subject: [PATCH] fix url base on invite and broken getLanguages --- main.go | 4 +++- views.go | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 1b902fa..6c745fc 100644 --- a/main.go +++ b/main.go @@ -596,7 +596,9 @@ func start(asDaemon, firstCall bool) { app.debug.Println("Loading pprof") pprof.Register(router) } - router.GET("/lang/:page", app.GetLanguages) + for _, p := range routePrefixes { + router.GET(p+"/lang/:page", app.GetLanguages) + } if !firstRun { for _, p := range routePrefixes { router.GET(p+"/", app.AdminPage) diff --git a/views.go b/views.go index 8a08f00..d13c1f8 100644 --- a/views.go +++ b/views.go @@ -166,7 +166,7 @@ func (app *appContext) InviteProxy(gc *gin.Context) { email = "" } gcHTML(gc, http.StatusOK, "form-loader.html", gin.H{ - "urlBase": app.getURLBase, + "urlBase": app.getURLBase(gc), "cssClass": app.cssClass, "contactMessage": app.config.Section("ui").Key("contact_message").String(), "helpMessage": app.config.Section("ui").Key("help_message").String(),