A few miscellaneous, minor fixes

This commit is contained in:
Matthew Holt 2020-01-06 08:10:20 -07:00
parent a6df4cdbbc
commit 5c99267dd8
No known key found for this signature in database
GPG key ID: 2A349DD577D586A5
3 changed files with 8 additions and 5 deletions

View file

@ -105,6 +105,9 @@ func parseReqHdrCaddyfile(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler,
}
if h.NextArg() {
replacement = h.Val()
if h.NextArg() {
return nil, h.ArgErr()
}
}
if hdr.Request == nil {

View file

@ -78,7 +78,7 @@ type ACMEManagerMaker struct {
// Optionally configure a separate storage module associated with this
// manager, instead of using Caddy's global/default-configured storage.
Storage json.RawMessage `json:"storage,omitempty"`
Storage json.RawMessage `json:"storage,omitempty" caddy:"namespace=caddy.storage inline_key=module"`
// An array of files of CA certificates to accept when connecting to the
// ACME CA. Generally, you should only use this if the ACME CA endpoint

View file

@ -107,10 +107,10 @@ func (t *TLS) Provision(ctx caddy.Context) error {
// special case; these will be loaded in later
// using our automation facilities, which we
// want to avoid during provisioning
var ok bool
t.automateNames, ok = modIface.([]string)
if !ok {
return fmt.Errorf("loading certificates with 'automate' requires []string, got: %#v", modIface)
if automateNames, ok := modIface.(*AutomateLoader); ok && automateNames != nil {
t.automateNames = []string(*automateNames)
} else {
return fmt.Errorf("loading certificates with 'automate' requires array of strings, got: %T", modIface)
}
continue
}