Преглед изворни кода

allow to start if only httpd service is enabled

Signed-off-by: Nicola Murino <[email protected]>
Nicola Murino пре 2 година
родитељ
комит
bd118e61bc
2 измењених фајлова са 7 додато и 0 уклоњено
  1. 3 0
      internal/config/config.go
  2. 4 0
      internal/config/config_test.go

+ 3 - 0
internal/config/config.go

@@ -591,6 +591,9 @@ func HasServicesToStart() bool {
 	if globalConf.WebDAVD.ShouldBind() {
 		return true
 	}
+	if globalConf.HTTPDConfig.ShouldBind() {
+		return true
+	}
 	return false
 }
 

+ 4 - 0
internal/config/config_test.go

@@ -386,6 +386,10 @@ func TestServiceToStart(t *testing.T) {
 	sftpdConf := config.GetSFTPDConfig()
 	sftpdConf.Bindings[0].Port = 0
 	config.SetSFTPDConfig(sftpdConf)
+	// httpd service is enabled
+	assert.True(t, config.HasServicesToStart())
+	httpdConf := config.GetHTTPDConfig()
+	httpdConf.Bindings[0].Port = 0
 	assert.False(t, config.HasServicesToStart())
 	ftpdConf := config.GetFTPDConfig()
 	ftpdConf.Bindings[0].Port = 2121