mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 18:53:43 -04:00
plugin/rewrite: use request.Request and other cleanups (#1920)
This was done anyway, but only deep in the functions, just do this everywhere; allows for shorter code and request.Request allows for caching as well. Cleanups, make it more Go like. * remove unneeded switches * remove testdir (why was this there??) * simplify the logic * remove unneeded variables * put short functions on a single line * fix documentation. * spin off wire funcs in wire.go, make them functions. Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
@@ -33,8 +33,7 @@ func NewResponseReverter(w dns.ResponseWriter, r *dns.Msg) *ResponseReverter {
|
||||
}
|
||||
}
|
||||
|
||||
// WriteMsg records the status code and calls the
|
||||
// underlying ResponseWriter's WriteMsg method.
|
||||
// WriteMsg records the status code and calls the underlying ResponseWriter's WriteMsg method.
|
||||
func (r *ResponseReverter) WriteMsg(res *dns.Msg) error {
|
||||
res.Question[0] = r.originalQuestion
|
||||
if r.ResponseRewrite {
|
||||
|
||||
Reference in New Issue
Block a user