Skip to content

Commit 94a5298

Browse files
修复在不存在配置时指定了 CNAME 不生效的问题
1 parent 1d5ee04 commit 94a5298

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/core/meta.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,15 @@ func (s *ServerMeta) parsePageConfig(ctx context.Context, meta *PageMetaContent,
172172
data, err := vfs.ReadString(ctx, ".pages.yaml")
173173
if err != nil {
174174
zap.L().Debug("failed to read meta data", zap.String("error", err.Error()))
175+
if len(alias) > 0 {
176+
meta.Filters = append(meta.Filters, Filter{
177+
Path: "**",
178+
Type: "redirect",
179+
Params: map[string]any{
180+
"targets": alias,
181+
},
182+
})
183+
}
175184
return nil // 配置文件不存在不是错误
176185
}
177186

0 commit comments

Comments
 (0)