Former-commit-id: 13d1a274518ed6b2fdfa9fefd02021b0ebc3071f
This commit is contained in:
Gerasimos (Makis) Maropoulos 2017-10-01 06:26:21 +03:00
parent cf1e580cde
commit 3e6ec4d441

View File

@ -661,7 +661,12 @@ func (api *APIBuilder) StaticEmbedded(requestPath string, vdir string, assetFn f
fullpath := joinPath(api.relativePath, requestPath) fullpath := joinPath(api.relativePath, requestPath)
requestPath = joinPath(fullpath, WildcardParam("file")) 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) return api.registerResourceRoute(requestPath, h)
} }