Robots.txt support implemented

This commit is contained in:
Musab Gültekin
2019-07-06 16:18:03 +03:00
parent 2cab68d2ce
commit 42faa92ece
9 changed files with 154 additions and 64 deletions

View File

@@ -187,6 +187,16 @@ func TestConcurrentRequests(t *testing.T) {
}).Start()
}
func TestRobots(t *testing.T) {
defer leaktest.Check(t)()
geziyor.NewGeziyor(&geziyor.Options{
StartURLs: []string{"https://httpbin.org/deny"},
ParseFunc: func(g *geziyor.Geziyor, r *client.Response) {
t.Error("/deny should be blocked by robots.txt middleware")
},
}).Start()
}
// Make sure to increase open file descriptor limits before running
func BenchmarkRequests(b *testing.B) {