caddyfile: Support global config block; allow non-empty blocks w/ 0 keys

This commit is contained in:
Matthew Holt
2019-08-22 13:38:37 -06:00
parent a0fd2b6c0a
commit af25f0254e
8 changed files with 118 additions and 28 deletions

View File

@ -131,9 +131,8 @@ func loadConfig(configFile, adapterName string) ([]byte, error) {
// adapt config
if cfgAdapter != nil {
adaptedConfig, warnings, err := cfgAdapter.Adapt(config, map[string]string{
adaptedConfig, warnings, err := cfgAdapter.Adapt(config, map[string]interface{}{
"filename": configFile,
// TODO: all other options... (http-port, etc...)
})
if err != nil {
return nil, fmt.Errorf("adapting config using %s: %v", adapterName, err)