1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 10:27:06 +00:00

untested solution for https://github.com/kataras/iris/issues/717 , waiting for respond before push the minor version

Former-commit-id: 6c7f36dde24f36f513b4a6f939a6d52c18c6c8ed
This commit is contained in:
kataras
2017-08-12 07:02:56 +03:00
parent 23faae3f43
commit 71af9d7f45
3 changed files with 22 additions and 16 deletions

View File

@@ -450,9 +450,9 @@ func (rb *APIBuilder) registerResourceRoute(reqPath string, h context.Handler) *
// mySubdomainFsServer.Get("/static", h)
// ...
//
func (rb *APIBuilder) StaticHandler(systemPath string, showList bool, enableGzip bool) context.Handler {
func (rb *APIBuilder) StaticHandler(systemPath string, showList bool, gzip bool) context.Handler {
// Note: this doesn't need to be here but we'll keep it for consistently
return StaticHandler(systemPath, showList, enableGzip)
return StaticHandler(systemPath, showList, gzip)
}
// StaticServe serves a directory as web resource
@@ -632,7 +632,7 @@ func (rb *APIBuilder) Favicon(favPath string, requestPath ...string) *Route {
// ending in "/index.html" to the same path, without the final
// "index.html".
//
// StaticWeb calls the StaticHandler(systemPath, listingDirectories: false, gzip: false ).
// StaticWeb calls the `StripPrefix(fullpath, NewStaticHandlerBuilder(systemPath).Listing(false).Build())`.
//
// Returns the GET *Route.
func (rb *APIBuilder) StaticWeb(requestPath string, systemPath string) *Route {
@@ -641,7 +641,7 @@ func (rb *APIBuilder) StaticWeb(requestPath string, systemPath string) *Route {
fullpath := joinPath(rb.relativePath, requestPath)
h := StripPrefix(fullpath, rb.StaticHandler(systemPath, false, false))
h := StripPrefix(fullpath, NewStaticHandlerBuilder(systemPath).Listing(false).Build())
handler := func(ctx context.Context) {
h(ctx)