1
0
mirror of https://github.com/labstack/echo.git synced 2025-07-15 01:34:53 +02:00

fix #1260 change middleware.Logger's default output (#1336)

* fix TestLoggerIPAddress reverse assertion

* change middleware.Logger default output

* remove nil field declaration
This commit is contained in:
nattawitc
2019-07-18 11:34:31 +07:00
committed by Vishal Rana
parent 405b221ad4
commit 8cfaf50b8f
2 changed files with 7 additions and 5 deletions

View File

@ -70,18 +70,18 @@ func TestLoggerIPAddress(t *testing.T) {
// With X-Real-IP
req.Header.Add(echo.HeaderXRealIP, ip)
h(c)
assert.Contains(t, ip, buf.String())
assert.Contains(t, buf.String(), ip)
// With X-Forwarded-For
buf.Reset()
req.Header.Del(echo.HeaderXRealIP)
req.Header.Add(echo.HeaderXForwardedFor, ip)
h(c)
assert.Contains(t, ip, buf.String())
assert.Contains(t, buf.String(), ip)
buf.Reset()
h(c)
assert.Contains(t, ip, buf.String())
assert.Contains(t, buf.String(), ip)
}
func TestLoggerTemplate(t *testing.T) {