diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2020-02-27 21:03:45 -0700 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2020-02-27 21:04:28 -0700 |
commit | cef6e098bb278d50cb2f45f57ed40b3af47d6a74 (patch) | |
tree | 30399295c85adae450b8966851646037a1f7f5b2 /modules/caddyhttp | |
parent | 260982b2dfc2cbf30c9b6e3a06f54e589344fc41 (diff) |
Refactor ExtractMatcherSet()
Diffstat (limited to 'modules/caddyhttp')
-rw-r--r-- | modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go b/modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go index 7a65428..81fd48e 100644 --- a/modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go +++ b/modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go @@ -167,14 +167,10 @@ func parsePHPFastCGI(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error // either way, strip the matcher token and pass // the remaining tokens to the unmarshaler so that // we can gain the rest of the reverse_proxy syntax - userMatcherSet, hasUserMatcher, err := h.MatcherToken() + userMatcherSet, err := h.ExtractMatcherSet() if err != nil { return nil, err } - if hasUserMatcher { - h.Dispenser.Delete() // strip matcher token - } - h.Dispenser.Reset() // pretend this lookahead never happened // set up the transport for FastCGI, and specifically PHP fcgiTransport := Transport{SplitPath: ".php"} @@ -186,6 +182,8 @@ func parsePHPFastCGI(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error // the rest of the config is specified by the user // using the reverse_proxy directive syntax + // TODO: this can overwrite our fcgiTransport that we encoded and + // set on the rpHandler... even with a non-fastcgi transport! err = rpHandler.UnmarshalCaddyfile(h.Dispenser) if err != nil { return nil, err @@ -204,7 +202,7 @@ func parsePHPFastCGI(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error // the user's matcher is a prerequisite for ours, so // wrap ours in a subroute and return that - if hasUserMatcher { + if userMatcherSet != nil { return []httpcaddyfile.ConfigValue{ { Class: "route", |