Skip to content

Commit 1a4a8cb

Browse files
committed
BUG/MEDIUM: fix serialization of UseFCGIApp
It was failing with "invalid data"
1 parent aa18a1a commit 1a4a8cb

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

.aspell.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ allowed:
6565
- eslint
6666
- failsafe
6767
- fbt
68+
- usefcgiapp
6869
- formatter
6970
- formatters
7071
- frontend

configuration/configuration.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1704,6 +1704,8 @@ func (s *SectionObject) checkSpecialFields(fieldName string, field reflect.Value
17041704
return true, s.originalto(field)
17051705
case "LogSteps":
17061706
return true, s.logSteps(field)
1707+
case "UseFCGIApp":
1708+
return true, s.useFCGIApp(field)
17071709
default:
17081710
return false, nil
17091711
}
@@ -3025,6 +3027,20 @@ func (s *SectionObject) logSteps(field reflect.Value) error {
30253027
return s.set("log-steps", types.StringC{Value: d})
30263028
}
30273029

3030+
func (s *SectionObject) useFCGIApp(field reflect.Value) error {
3031+
if !(s.Section == parser.Backends) {
3032+
return nil
3033+
}
3034+
if valueIsNil(field) {
3035+
return s.set("use-fcgi-app", nil)
3036+
}
3037+
useFCGIApp := field.String()
3038+
if useFCGIApp == "" {
3039+
return nil
3040+
}
3041+
return s.set("use-fcgi-app", types.UseFcgiApp{Name: useFCGIApp})
3042+
}
3043+
30283044
func (c *client) deleteSection(section parser.Section, name string, transactionID string, version int64) error {
30293045
p, t, err := c.loadDataForChange(transactionID, version)
30303046
if err != nil {

0 commit comments

Comments
 (0)