From 5d2c1c885d8d9cfd1a5d21aa5b4e14e27e904bd7 Mon Sep 17 00:00:00 2001 From: hanemile Date: Wed, 29 Jul 2020 22:31:41 +0200 Subject: adjusted timeouts --- main.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'main.go') diff --git a/main.go b/main.go index 35f32dc..fa7eda7 100644 --- a/main.go +++ b/main.go @@ -8,8 +8,10 @@ import ( "net/http" "os" "strings" + "time" "gopkg.in/h2non/gentleman.v2" + "gopkg.in/h2non/gentleman.v2/plugins/timeout" ) var session = flag.String("session", "9e8831af-ce30-48c3-8663-4b27262f43f1.pjKPVCYufDhuA9GPJAlc_xh45M8", "The session (the value of the cookie named 'session')") @@ -65,6 +67,10 @@ func fetchAllChallenges() (Challenges, error) { cli := gentleman.New() cli.URL(*rootURL) + // define the timeouts outrageously long, as some CTFs hosted using CTFd are incredibly inresponsive. + cli.Use(timeout.Request(1000 * time.Second)) + cli.Use(timeout.Dial(1000 * time.Second, 2000 * time.Second)) + req := cli.Request() req.Path("/api/v1/challenges") -- cgit 1.4.1