mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 02:33:14 -04:00
Fix proxy upstream parser issue and add test cases (#263)
This fix tries to fix 261 where proxy upstream parser is not able to parse upstream correctly. Several test cases have also been added to cover the changes and prevent regression in the future. This fix fixes 261. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
@@ -44,7 +44,7 @@ type Options struct {
|
||||
|
||||
// NewStaticUpstreams parses the configuration input and sets up
|
||||
// static upstreams for the proxy middleware.
|
||||
func NewStaticUpstreams(c caddyfile.Dispenser) ([]Upstream, error) {
|
||||
func NewStaticUpstreams(c *caddyfile.Dispenser) ([]Upstream, error) {
|
||||
var upstreams []Upstream
|
||||
for c.Next() {
|
||||
upstream := &staticUpstream{
|
||||
@@ -126,7 +126,7 @@ func (u *staticUpstream) Options() Options {
|
||||
return u.options
|
||||
}
|
||||
|
||||
func parseBlock(c caddyfile.Dispenser, u *staticUpstream) error {
|
||||
func parseBlock(c *caddyfile.Dispenser, u *staticUpstream) error {
|
||||
switch c.Val() {
|
||||
case "policy":
|
||||
if !c.NextArg() {
|
||||
|
||||
Reference in New Issue
Block a user