From 09389e2739d4326ad8ee96df7867df80c40d7de3 Mon Sep 17 00:00:00 2001 From: Anant Shrivastava Date: Sun, 12 May 2024 16:12:25 +0530 Subject: [PATCH] Update ui.go probable fix --- pkg/authn/ui/ui.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pkg/authn/ui/ui.go b/pkg/authn/ui/ui.go index 55b6e38..3270b38 100644 --- a/pkg/authn/ui/ui.go +++ b/pkg/authn/ui/ui.go @@ -22,6 +22,7 @@ import ( "path" "strings" "text/template" + "net/url" ) // Themes stores UI themes. @@ -276,9 +277,20 @@ func (f *Factory) DeleteTemplates() { return } +func customPathJoin(args ...string) string { + // Example of additional logic: cleaning each path part before joining + encodedArgs := make([]string, len(args)) + for i, arg := range args { + encodedArgs[i] = url.QueryEscape(arg) + } + // Join the cleaned path elements + joinedPath := path.Join(encodedArgs...) + return joinedPath +} + func loadTemplateFromString(s, p string) (*template.Template, error) { funcMap := template.FuncMap{ - "pathjoin": path.Join, + "pathjoin": customPathJoin, "brsplitline": func(s string) string { var output []rune var count = 0