@@ -9,13 +9,11 @@ import (
99 "strings"
1010)
1111
12- type filterCallback func ([]os.FileInfo ) []os.FileInfo
1312type archiveCallback func (f * os.File , fInfo os.FileInfo , relPath string ) error
1413
1514func (h * handler ) visitFs (
1615 initFsPath , rawRequestPath , relPath string ,
1716 statFs bool ,
18- filterCallback filterCallback ,
1917 archiveCallback archiveCallback ,
2018) {
2119 alias , hasAlias := h .aliases .byUrlPath (rawRequestPath )
@@ -65,7 +63,7 @@ func (h *handler) visitFs(
6563 if h .errHandler .LogError (err ) {
6664 return err
6765 }
68- childInfos = filterCallback (childInfos )
66+ childInfos = h . FilterItems (childInfos )
6967 }
7068
7169 return nil
@@ -107,17 +105,17 @@ func (h *handler) visitFs(
107105 childRelPath := relPath + childPath
108106
109107 if childAliasedFsPath , hasChildAlias := childAliases [childRawRequestPath ]; hasChildAlias {
110- h .visitFs (childAliasedFsPath , childRawRequestPath , childRelPath , statFs , filterCallback , archiveCallback )
108+ h .visitFs (childAliasedFsPath , childRawRequestPath , childRelPath , statFs , archiveCallback )
111109 delete (childAliases , childRawRequestPath ) // delete walked alias
112110 } else {
113- h .visitFs (childFsPath , childRawRequestPath , childRelPath , statFs , filterCallback , archiveCallback )
111+ h .visitFs (childFsPath , childRawRequestPath , childRelPath , statFs , archiveCallback )
114112 }
115113 }
116114
117115 // rest aliases are standalone aliases that not shadows exists dir/file
118116 for childRawRequestPath , childAliasedFsPath := range childAliases {
119117 childRelPath := relPath + "/" + path .Base (childRawRequestPath )
120- h .visitFs (childAliasedFsPath , childRawRequestPath , childRelPath , statFs , filterCallback , archiveCallback )
118+ h .visitFs (childAliasedFsPath , childRawRequestPath , childRelPath , statFs , archiveCallback )
121119 }
122120 }
123121}
@@ -128,7 +126,6 @@ func (h *handler) archive(
128126 pageData * responseData ,
129127 fileSuffix string ,
130128 contentType string ,
131- filterCallback filterCallback ,
132129 cbWriteFile archiveCallback ,
133130) {
134131 var itemName string
@@ -152,7 +149,6 @@ func (h *handler) archive(
152149 pageData .rawReqPath ,
153150 "" ,
154151 ! h .emptyRoot ,
155- filterCallback ,
156152 func (f * os.File , fInfo os.FileInfo , relPath string ) error {
157153 go h .logArchive (targetFilename , relPath , r )
158154 err := cbWriteFile (f , fInfo , relPath )
0 commit comments