Skip to content

Commit 5c37cd3

Browse files
fix(caddy): reject invalid split_path at provision time (#2350)
A non-ASCII `split_path` caused `WithRequestSplitPath`'s error to be swallowed and a nil `RequestOption` to be stored, panicking on the first request. The fix propagates the error from `Provision`, rejecting the config at startup with a clear message.
1 parent 5a9bc7f commit 5c37cd3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

caddy/module.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ func (f *FrankenPHPModule) Provision(ctx caddy.Context) error {
117117
f.SplitPath = []string{".php"}
118118
}
119119

120-
if opt, err := frankenphp.WithRequestSplitPath(f.SplitPath); err == nil {
121-
f.requestOptions = append(f.requestOptions, opt)
122-
} else {
123-
f.requestOptions = append(f.requestOptions, opt)
120+
opt, err := frankenphp.WithRequestSplitPath(f.SplitPath)
121+
if err != nil {
122+
return fmt.Errorf("invalid split_path: %w", err)
124123
}
124+
f.requestOptions = append(f.requestOptions, opt)
125125

126126
if f.ResolveRootSymlink == nil {
127127
f.ResolveRootSymlink = new(true)

0 commit comments

Comments
 (0)