(t *testing.T)
| 22 | } |
| 23 | |
| 24 | func TestReverseProxyNoInject(t *testing.T) { |
| 25 | ci := CopyInject{ |
| 26 | Within: 100, |
| 27 | ContentType: "text/html", |
| 28 | Marker: regexp.MustCompile("mark"), |
| 29 | Payload: []byte("inject"), |
| 30 | } |
| 31 | found, dst, err := inject(ci, "imark", "text/plain") |
| 32 | if err != nil || found || dst != "imark" { |
| 33 | t.Errorf("Unexpected, found:%v dst:%v error:%v", dst, found, err) |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | func TestReverseProxy(t *testing.T) { |
| 38 | var sniffTests = []struct { |