@marcel91200 / caddy Mirror · read-only / commits / 5c99267d
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 14, 05:15 UTC

A few miscellaneous, minor fixes

Matthew Holt committed Jan 6, 2020 at 08:10 UTC 5c99267dd870936a02f942130302b76b1f15efa2
3 files changed +8 -5
modules/caddyhttp/headers/caddyfile.go
+3
@@ -105,6 +105,9 @@ func parseReqHdrCaddyfile(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler,
105 }
106 if h.NextArg() {
107 replacement = h.Val()
108 + if h.NextArg() {
109 + return nil, h.ArgErr()
110 + }
111 }
112
113 if hdr.Request == nil {
modules/caddytls/acmemanager.go
+1 -1
@@ -78,7 +78,7 @@ type ACMEManagerMaker struct {
78
79 // Optionally configure a separate storage module associated with this
80 // manager, instead of using Caddy's global/default-configured storage.
81 - Storage json.RawMessage `json:"storage,omitempty"`
81 + Storage json.RawMessage `json:"storage,omitempty" caddy:"namespace=caddy.storage inline_key=module"`
82
83 // An array of files of CA certificates to accept when connecting to the
84 // ACME CA. Generally, you should only use this if the ACME CA endpoint
modules/caddytls/tls.go
+4 -4
@@ -107,10 +107,10 @@ func (t *TLS) Provision(ctx caddy.Context) error {
107 // special case; these will be loaded in later
108 // using our automation facilities, which we
109 // want to avoid during provisioning
110 - var ok bool
111 - t.automateNames, ok = modIface.([]string)
112 - if !ok {
113 - return fmt.Errorf("loading certificates with 'automate' requires []string, got: %#v", modIface)
110 + if automateNames, ok := modIface.(*AutomateLoader); ok && automateNames != nil {
111 + t.automateNames = []string(*automateNames)
112 + } else {
113 + return fmt.Errorf("loading certificates with 'automate' requires array of strings, got: %T", modIface)
114 }
115 continue
116 }