mirror of
https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin.git
synced 2026-07-21 03:28:59 +02:00
add vendor
This commit is contained in:
@@ -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))
|
||||
// }
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user