add vendor

This commit is contained in:
Max Lerebourg
2022-09-28 17:52:24 +02:00
parent c15dcedab8
commit 5a370d9a88
9 changed files with 1094 additions and 29 deletions
-17
View File
@@ -12,10 +12,6 @@ import (
func TestDemo(t *testing.T) {
cfg := crowdsec_bouncer_traefik_plugin.CreateConfig()
cfg.CrowdsecLapiKey = "caca"
// cfg.Headers["X-Method"] = "[[.Method]]"
// cfg.Headers["X-URL"] = "[[.URL]]"
// cfg.Headers["X-URL"] = "[[.URL]]"
// cfg.Headers["X-Demo"] = "test"
ctx := context.Background()
next := http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {})
@@ -33,17 +29,4 @@ func TestDemo(t *testing.T) {
}
handler.ServeHTTP(recorder, req)
// assertHeader(t, req, "X-Host", "localhost")
// assertHeader(t, req, "X-URL", "http://localhost")
// assertHeader(t, req, "X-Method", "GET")
// assertHeader(t, req, "X-Demo", "test")
}
// func assertHeader(t *testing.T, req *http.Request, key, expected string) {
// t.Helper()
// if req.Header.Get(key) != expected {
// t.Errorf("invalid header value: %s", req.Header.Get(key))
// }
// }