mirror of
https://github.com/coredns/coredns.git
synced 2025-11-21 03:12:16 -05:00
Revert pkg/nonwriter changes (#1829)
The DoH work (#1619) made changes to pkg/nonwriter.Writer that in hindsight were not backwards compatible; it added override for the LocalAddr() and RemoteAddr(). Instead of rolling back that PR, this PR reverts those changes and creates a DoHWriter for use in the https-server.go side of things. This was only caught in the integration test making this hard to catch, so we add a upstream_file_test.go that tries (doesn't work yet) to test this in the unit tests as well. Esp. helpful when 'git bisecting'. Fixes #1826
This commit is contained in:
committed by
Chris O'Haver
parent
49891d2103
commit
0f74281a53
@@ -2,8 +2,6 @@
|
||||
package nonwriter
|
||||
|
||||
import (
|
||||
"net"
|
||||
|
||||
"github.com/miekg/dns"
|
||||
)
|
||||
|
||||
@@ -11,11 +9,6 @@ import (
|
||||
type Writer struct {
|
||||
dns.ResponseWriter
|
||||
Msg *dns.Msg
|
||||
|
||||
// Raddr is the remote's address. This can be optionally set.
|
||||
Raddr net.Addr
|
||||
// Laddr is our address. This can be optionally set.
|
||||
Laddr net.Addr
|
||||
}
|
||||
|
||||
// New makes and returns a new NonWriter.
|
||||
@@ -26,9 +19,3 @@ func (w *Writer) WriteMsg(res *dns.Msg) error {
|
||||
w.Msg = res
|
||||
return nil
|
||||
}
|
||||
|
||||
// RemoteAddr returns the remote address.
|
||||
func (w *Writer) RemoteAddr() net.Addr { return w.Raddr }
|
||||
|
||||
// LocalAddr returns the local address.
|
||||
func (w *Writer) LocalAddr() net.Addr { return w.Laddr }
|
||||
|
||||
Reference in New Issue
Block a user