diff options
author | 2016-04-07 07:42:58 +0100 | |
---|---|---|
committer | 2016-04-07 07:42:58 +0100 | |
commit | e4c72719bfb10d5bc5d79a172d8a0b5e852acc2a (patch) | |
tree | 07eeee7624a6edd2a36670c610d9fee3934f04ca /middleware/state.go | |
parent | 225cdd1ca387b409c07269db44100643fccb620c (diff) | |
download | coredns-e4c72719bfb10d5bc5d79a172d8a0b5e852acc2a.tar.gz coredns-e4c72719bfb10d5bc5d79a172d8a0b5e852acc2a.tar.zst coredns-e4c72719bfb10d5bc5d79a172d8a0b5e852acc2a.zip |
Test and fix notify
More tests and add RemoteAddr to State, prolly LocalAddr will be
useful as well.
Fixed and tested IsNotify method.
Diffstat (limited to 'middleware/state.go')
-rw-r--r-- | middleware/state.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/middleware/state.go b/middleware/state.go index 2a7b2ac1d..fb324d780 100644 --- a/middleware/state.go +++ b/middleware/state.go @@ -50,6 +50,11 @@ func (s *State) Port() (string, error) { return port, nil } +// RemoteAddr returns the net.Addr of the client that sent the current request. +func (s *State) RemoteAddr() string { + return s.W.RemoteAddr().String() +} + // Proto gets the protocol used as the transport. This // will be udp or tcp. func (s *State) Proto() string { |