fix(static): add missing AutoIndex and Internal settings in registerStaticHandlers
The registerStaticHandlers function (used in multi-server mode) was missing AutoIndex and Internal configuration that registerStaticHandlersWithLocationEngine already had. This caused auto_index to not work in multi-server mode. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
4b48fd71e6
commit
03c27c8d95
@ -243,11 +243,24 @@ func (s *Server) registerStaticHandlers(router *handler.Router, cfg *config.Serv
|
|||||||
// 设置符号链接安全检查
|
// 设置符号链接安全检查
|
||||||
staticHandler.SetSymlinkCheck(static.SymlinkCheck)
|
staticHandler.SetSymlinkCheck(static.SymlinkCheck)
|
||||||
|
|
||||||
|
// 设置 internal 限制
|
||||||
|
staticHandler.SetInternal(static.Internal)
|
||||||
|
|
||||||
// 设置缓存过期时间
|
// 设置缓存过期时间
|
||||||
if static.Expires != "" {
|
if static.Expires != "" {
|
||||||
staticHandler.SetExpires(static.Expires)
|
staticHandler.SetExpires(static.Expires)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 设置目录列表
|
||||||
|
if static.AutoIndex {
|
||||||
|
staticHandler.SetAutoIndex(
|
||||||
|
static.AutoIndex,
|
||||||
|
static.AutoIndexFormat,
|
||||||
|
static.AutoIndexLocaltime,
|
||||||
|
static.AutoIndexExactSize,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// 设置 try_files 配置
|
// 设置 try_files 配置
|
||||||
if len(static.TryFiles) > 0 {
|
if len(static.TryFiles) > 0 {
|
||||||
// 注意:tryFilesPass 需要路由器支持,当前实现传入 nil
|
// 注意:tryFilesPass 需要路由器支持,当前实现传入 nil
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user