mirror of
https://github.com/infinite-iroha/touka.git
synced 2026-02-03 08:51:11 +08:00
fix: missed engine.UnMatchFSRoutes set value
This commit is contained in:
parent
989eb34c4c
commit
336b8ad958
1 changed files with 1 additions and 16 deletions
17
engine.go
17
engine.go
|
|
@ -281,22 +281,6 @@ func (engine *Engine) GetDefaultErrHandler() ErrorHandler {
|
||||||
return defaultErrorHandle
|
return defaultErrorHandle
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
// 传入并配置unMatchFS
|
|
||||||
func (engine *Engine) SetUnMatchFS(fs http.FileSystem) {
|
|
||||||
if fs != nil {
|
|
||||||
engine.unMatchFS.FSForUnmatched = fs
|
|
||||||
engine.unMatchFS.ServeUnmatchedAsFS = true
|
|
||||||
engine.unMatchFileServer = GetStaticFSHandleFunc(http.FileServer(fs))
|
|
||||||
engine.UnMatchFSRoutes = HandlersChain{engine.unMatchFileServer}
|
|
||||||
} else {
|
|
||||||
engine.unMatchFS.ServeUnmatchedAsFS = false
|
|
||||||
engine.unMatchFileServer = nil
|
|
||||||
engine.UnMatchFSRoutes = nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
func (engine *Engine) SetUnMatchFS(fs http.FileSystem, handlers ...HandlerFunc) {
|
func (engine *Engine) SetUnMatchFS(fs http.FileSystem, handlers ...HandlerFunc) {
|
||||||
engine.SetUnMatchFSChain(fs, handlers...)
|
engine.SetUnMatchFSChain(fs, handlers...)
|
||||||
}
|
}
|
||||||
|
|
@ -309,6 +293,7 @@ func (engine *Engine) SetUnMatchFSChain(fs http.FileSystem, handlers ...HandlerF
|
||||||
combinedChain := make(HandlersChain, len(handlers)+1)
|
combinedChain := make(HandlersChain, len(handlers)+1)
|
||||||
copy(combinedChain, handlers)
|
copy(combinedChain, handlers)
|
||||||
combinedChain[len(handlers)] = unMatchFileServer
|
combinedChain[len(handlers)] = unMatchFileServer
|
||||||
|
engine.UnMatchFSRoutes = combinedChain
|
||||||
} else {
|
} else {
|
||||||
engine.unMatchFS.ServeUnmatchedAsFS = false
|
engine.unMatchFS.ServeUnmatchedAsFS = false
|
||||||
engine.UnMatchFSRoutes = nil
|
engine.UnMatchFSRoutes = nil
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue