summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2020-02-14 11:00:16 -0700
committerMatthew Holt <mholt@users.noreply.github.com>2020-02-14 11:01:09 -0700
commit15bf9c196c5972051f40ebadf50811bd06e328dd (patch)
tree03362b73a9bdd923bf4f252e346a8441f5de04b0 /modules
parenteb80165583776d878256359f1635ffa9a17f0171 (diff)
caddyfile: Refactor; NewFromNextSegment(); fix repeated matchers
Now multiple instances of the same matcher can be used within a named matcher without overwriting previous ones.
Diffstat (limited to 'modules')
-rw-r--r--modules/caddyhttp/encode/caddyfile.go2
-rw-r--r--modules/caddyhttp/matchers.go2
-rw-r--r--modules/caddyhttp/reverseproxy/caddyfile.go4
3 files changed, 4 insertions, 4 deletions
diff --git a/modules/caddyhttp/encode/caddyfile.go b/modules/caddyhttp/encode/caddyfile.go
index dd12de2..629f0e2 100644
--- a/modules/caddyhttp/encode/caddyfile.go
+++ b/modules/caddyhttp/encode/caddyfile.go
@@ -73,7 +73,7 @@ func (enc *Encode) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
if !ok {
return fmt.Errorf("encoder module '%s' is not a Caddyfile unmarshaler", mod)
}
- err = unm.UnmarshalCaddyfile(d.NewFromNextTokens())
+ err = unm.UnmarshalCaddyfile(d.NewFromNextSegment())
if err != nil {
return err
}
diff --git a/modules/caddyhttp/matchers.go b/modules/caddyhttp/matchers.go
index 873b63d..552aa91 100644
--- a/modules/caddyhttp/matchers.go
+++ b/modules/caddyhttp/matchers.go
@@ -520,7 +520,7 @@ func (m *MatchNegate) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
if !ok {
return d.Errf("matcher module '%s' is not a Caddyfile unmarshaler", matcherName)
}
- err = unm.UnmarshalCaddyfile(d.NewFromNextTokens())
+ err = unm.UnmarshalCaddyfile(d.NewFromNextSegment())
if err != nil {
return err
}
diff --git a/modules/caddyhttp/reverseproxy/caddyfile.go b/modules/caddyhttp/reverseproxy/caddyfile.go
index f29050f..d08e7f1 100644
--- a/modules/caddyhttp/reverseproxy/caddyfile.go
+++ b/modules/caddyhttp/reverseproxy/caddyfile.go
@@ -114,7 +114,7 @@ func (h *Handler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
if !ok {
return d.Errf("load balancing policy module '%s' is not a Caddyfile unmarshaler", mod)
}
- err = unm.UnmarshalCaddyfile(d.NewFromNextTokens())
+ err = unm.UnmarshalCaddyfile(d.NewFromNextSegment())
if err != nil {
return err
}
@@ -401,7 +401,7 @@ func (h *Handler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
if !ok {
return d.Errf("transport module '%s' is not a Caddyfile unmarshaler", mod)
}
- err = unm.UnmarshalCaddyfile(d.NewFromNextTokens())
+ err = unm.UnmarshalCaddyfile(d.NewFromNextSegment())
if err != nil {
return err
}