mirror of
https://github.com/Quiq/docker-registry-ui.git
synced 2025-09-05 15:11:29 +00:00
URL encode repo variable in templates to support images with slash in the name
This commit is contained in:
11
main.go
11
main.go
@@ -122,6 +122,17 @@ func main() {
|
||||
}
|
||||
return res
|
||||
})
|
||||
view.AddGlobal("url_encoded_path", func(m interface{}) string {
|
||||
return url.PathEscape(m.(string))
|
||||
|
||||
})
|
||||
view.AddGlobal("url_decoded_path", func(m interface{}) string {
|
||||
res, err := url.PathUnescape(m.(string))
|
||||
if err != nil {
|
||||
return m.(string)
|
||||
}
|
||||
return res
|
||||
})
|
||||
e := echo.New()
|
||||
e.Renderer = &template{View: view}
|
||||
|
||||
|
Reference in New Issue
Block a user