abiosoft / abiosoft/caddy-yaml

module name 'zstd': module value cannot be null

Aperta
#4 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Go
Stelle
30
Fork
2
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Config in YAML:
```---
apps:
http:
servers:
srv0:
listen:
- ":443"
routes:
- match:
- host:
- sub.example.com
- handle:
- handler: encode
encodings:
gzip:
level: 9
zstd:
prefer:
- zstd
- gzip
- handler: file_server
- terminal: true
...
```

### Problem:
The YAML adapter translates this line `zstd:` into JSON `"zstd": null` resulting in the error.

### Fix:
Translating it into `"zstd": {}` fixes it.
So either config adapter needs to not output it `null` or caddy needs to load module even if its null.

### Workaround:
For now I'm replacing it with this line which is basically JSON in yaml which defeats the purpose of using YAML config
```encodings: { gzip: {level: 9}, zstd: {} }```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.