Defer loading directives until needed (fix for previous commit)

This change is still experimental.
This commit is contained in:
Matthew Holt
2016-08-25 00:15:18 -06:00
parent 5a691fbaf5
commit 17709a7d3f
3 changed files with 8 additions and 7 deletions

View File

@@ -26,7 +26,7 @@ func init() {
flag.BoolVar(&QUIC, "quic", false, "Use experimental QUIC")
caddy.RegisterServerType(serverType, caddy.ServerType{
Directives: directives,
Directives: func() []string { return directives },
DefaultInput: func() caddy.Input {
if Port == DefaultPort && Host != "" {
// by leaving the port blank in this case we give auto HTTPS