1
0
Fork 0

Print access logs for rejected requests and warn about new behavior

This commit is contained in:
Kevin Pollet 2025-12-16 15:36:05 +01:00 committed by GitHub
parent 0a3239463b
commit 1e0e03edc7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 486 additions and 191 deletions

View file

@ -1695,16 +1695,16 @@ func (s *SimpleSuite) TestDenyFragment() {
s.composeUp()
defer s.composeDown()
s.traefikCmd(withConfigFile("fixtures/simple_default.toml"))
file := s.adaptFile("fixtures/simple_deny.toml", struct{}{})
_, _ = s.cmdTraefik(withConfigFile(file))
// Expected a 404 as we did not configure anything
err := try.GetRequest("http://127.0.0.1:8000/", 1*time.Second, try.StatusCodeIs(http.StatusNotFound))
err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("Host(`deny.localhost`)"))
require.NoError(s.T(), err)
conn, err := net.Dial("tcp", "127.0.0.1:8000")
require.NoError(s.T(), err)
_, err = conn.Write([]byte("GET /#/?bar=toto;boo=titi HTTP/1.1\nHost: other.localhost\n\n"))
_, err = conn.Write([]byte("GET /#/?bar=toto;boo=titi HTTP/1.1\nHost: deny.localhost\n\n"))
require.NoError(s.T(), err)
resp, err := http.ReadResponse(bufio.NewReader(conn), nil)