From 3e6ec4d4414301d8b0c640bb032ea1ddbdaad649 Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Sun, 1 Oct 2017 06:26:21 +0300 Subject: [PATCH] fix https://github.com/kataras/iris/issues/762 Former-commit-id: 13d1a274518ed6b2fdfa9fefd02021b0ebc3071f --- core/router/api_builder.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/router/api_builder.go b/core/router/api_builder.go index 48c0587c..c3289bcf 100644 --- a/core/router/api_builder.go +++ b/core/router/api_builder.go @@ -661,7 +661,12 @@ func (api *APIBuilder) StaticEmbedded(requestPath string, vdir string, assetFn f fullpath := joinPath(api.relativePath, requestPath) requestPath = joinPath(fullpath, WildcardParam("file")) - h := StripPrefix(fullpath, api.StaticEmbeddedHandler(vdir, assetFn, namesFn)) + h := api.StaticEmbeddedHandler(vdir, assetFn, namesFn) + + if fullpath != "/" { + h = StripPrefix(fullpath, h) + } + return api.registerResourceRoute(requestPath, h) }