func (m *MatchHeader) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
	if *m == nil {
		*m = make(map[string][]string)
	}
	for d.Next() {
		var field, val string
		if !d.Args(&field) {
			return d.Errf("malformed header matcher: expected field")
		}

		if strings.HasPrefix(field, "!") {
			if len(field) == 1 {
				return d.Errf("malformed header matcher: must have field name following ! character")
			}

			field = field[1:]
			headers := *m
			headers[field] = nil
			m = &headers
			if d.NextArg() {
				return d.Errf("malformed header matcher: null matching headers cannot have a field value")
			}
		} else {
			if !d.NextArg() {
				return d.Errf("malformed header matcher: expected both field and value")
			}

			// If multiple header matchers with the same header field are defined,
			// we want to add the existing to the list of headers (will be OR'ed)
			val = d.Val()
			http.Header(*m).Add(field, val)
		}

		if d.NextBlock(0) {
			return d.Err("malformed header matcher: blocks are not supported")
		}
	}
	return nil
}
// UnmarshalCaddyfile implements caddyfile.Unmarshaler.
UnmarshalCaddyfile implements caddyfile.Unmarshaler.
// UnmarshalCaddyfile implements caddyfile . Unmarshaler .
func (m *MatchHeader) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
	if *m == nil {
		*m = make(map[string][]string)
	}
	for d.Next() {
		var field, val string
		if !d.Args(&field) {
			return d.Errf("malformed header matcher: expected field")
		}
		if strings.HasPrefix(field, "!") {
			if len(field) == 1 {
				return d.Errf("malformed header matcher: must have field name following ! character")
			}
			field = field[1:]
			headers := *m
			headers[field] = nil
			m = &headers
			if d.NextArg() {
				return d.Errf("malformed header matcher: null matching headers cannot have a field value")
			}
		} else {
			if !d.NextArg() {
				return d.Errf("malformed header matcher: expected both field and value")
			}
			val = d.Val()
			http.Header(*m).Add(field, val)
		}
		if d.NextBlock(0) {
			return d.Err("malformed header matcher: blocks are not supported")
		}
	}
	return nil
}
func ( m * MatchHeader ) UnmarshalCaddyfile ( d * caddyfile . Dispenser ) error { if * m == nil { * m = make ( map [ string ] [ ] string ) } for d . Next ( ) { var field , val string if ! d . Args ( & field ) { return d . Errf ( " " ) } if strings . HasPrefix ( field , " " ) { if len ( field ) == 1 { return d . Errf ( " " ) } field = field [ 1 : ] headers := * m headers [ field ] = nil m = & headers if d . NextArg ( ) { return d . Errf ( " " ) } } else { if ! d . NextArg ( ) { return d . Errf ( " " ) } val = d . Val ( ) http . Header ( * m ) . Add ( field , val ) } if d . NextBlock ( 0 ) { return d . Err ( " " ) } } return nil }
UnmarshalCaddyfile implements caddyfile.Unmarshaler.
UnmarshalCaddyfile implements caddyfile . Unmarshaler .
// If multiple header matchers with the same header field are defined, // we want to add the existing to the list of headers (will be OR'ed)