func NewCopyModifier(from, to string) martian.RequestResponseModifier {
	return &copyModifier{
		from: from,
		to:   to,
	}
}
NewCopyModifier returns a modifier that will copy the header in from to the
header in to.
package header
import (
	"encoding/json"
	"net/http"
	"github.com/google/martian/v3"
	"github.com/google/martian/v3/log"
	"github.com/google/martian/v3/parse"
	"github.com/google/martian/v3/proxyutil"
)
func init() {
	parse.Register("header.Copy", copyModifierFromJSON)
}
type copyModifier struct {
	from, to string
}
type copyModifierJSON struct {
	From  string               `json:"from"`
	To    string               `json:"to"`
	Scope []parse.ModifierType `json:"scope"`
}
func (m *copyModifier) ModifyRequest(req *http.Request) error {
	log.Debugf("header: copyModifier.ModifyRequest %s, from: %s, to: %s", req.URL, m.from, m.to)
	h := proxyutil.RequestHeader(req)
	return h.Set(m.to, h.Get(m.from))
}
func (m *copyModifier) ModifyResponse(res *http.Response) error {
	log.Debugf("header: copyModifier.ModifyResponse %s, from: %s, to: %s", res.Request.URL, m.from, m.to)
	h := proxyutil.ResponseHeader(res)
	return h.Set(m.to, h.Get(m.from))
}