Skip to content

Commit

Permalink
fix(caddy): resolve_root_symlink not taken into account (#1001)
Browse files Browse the repository at this point in the history
* Prevents parsing from always throwing an error.

* Removes empty line.

* Accepts suggestions.

* Accepts suggestions.

* Fixes syntax.

* Fixes formatting.

* chore: use a guard close

---------

Co-authored-by: a.stecher <[email protected]>
Co-authored-by: Kévin Dunglas <[email protected]>
  • Loading branch information
3 people authored Aug 26, 2024
1 parent db12b4e commit f5bec5c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions caddy/caddy.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,19 +359,19 @@ func (f *FrankenPHPModule) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
f.preparedEnv[args[0]+"\x00"] = args[1]

case "resolve_root_symlink":
if d.NextArg() {
if v, err := strconv.ParseBool(d.Val()); err == nil {
f.ResolveRootSymlink = &v

if d.NextArg() {
return d.ArgErr()
}
}
if !d.NextArg() {
continue
}

v, err := strconv.ParseBool(d.Val())
if err != nil {
return err
}
if d.NextArg() {
return d.ArgErr()
}
rrs := true
f.ResolveRootSymlink = &rrs

f.ResolveRootSymlink = &v
}
}
}
Expand Down

0 comments on commit f5bec5c

Please sign in to comment.