コード例 #1
0
ファイル: worker_test.go プロジェクト: Matir/gobuster
func TestTryMangleURL_Basic(t *testing.T) {
	resp := mock.ResponseFromString("")
	resp.StatusCode = 200
	client := &mock.MockClient{
		ForeverResponse: resp,
	}
	ss := &settings.ScanSettings{
		SpiderCodes: []int{200},
		Mangle:      true,
	}
	rchan := make(chan results.Result)
	go func() {
		for range rchan {
		}
	}()
	w := &Worker{
		client:   client,
		settings: ss,
		rchan:    rchan,
		adder:    noopUrl,
	}
	u := &url.URL{Scheme: "http", Host: "localhost", Path: "/"}
	w.TryMangleURL(u)
	// TODO: check which requests were made
}
コード例 #2
0
ファイル: worker_test.go プロジェクト: Matir/gobuster
func TestTryURL_Basic(t *testing.T) {
	resp := mock.ResponseFromString("")
	resp.StatusCode = 200
	u := &url.URL{Scheme: "http", Host: "localhost", Path: "/"}
	TryURLHelper(u, resp)
	// TODO: check which requests were made
}