diff --git a/iris.go b/iris.go index d7f4734d..e660cc8c 100644 --- a/iris.go +++ b/iris.go @@ -648,7 +648,7 @@ func (app *Application) Run(serve Runner, withOrWithout ...Configurator) error { app.Configure(withOrWithout...) app.logger.Debugf("Application: running using %d host(s)", len(app.Hosts)+1) - if !app.config.DisableVersionChecker && app.logger.Printer.IsTerminal { + if !app.config.DisableVersionChecker && app.logger.Level != golog.DisableLevel { go CheckVersion() } diff --git a/middleware/recaptcha/recaptcha.go b/middleware/recaptcha/recaptcha.go index 192beb55..d56e5da8 100644 --- a/middleware/recaptcha/recaptcha.go +++ b/middleware/recaptcha/recaptcha.go @@ -24,7 +24,11 @@ type Response struct { Success bool `json:"success"` } -var client = netutil.Client(time.Duration(10 * time.Second)) +// Client is the default `net/http#Client` instance which +// is used to send requests to the Google API. +// +// Change Client only if you know what you're doing. +var Client = netutil.Client(time.Duration(20 * time.Second)) // New accepts the google's recaptcha secret key and returns // a middleware that verifies the request by sending a response to the google's API(V2-latest). @@ -54,7 +58,7 @@ func SiteFerify(ctx context.Context, secret string) (response Response) { return } - r, err := client.PostForm(apiURL, + r, err := Client.PostForm(apiURL, url.Values{ "secret": {secret}, "response": {generatedResponseID}, diff --git a/version.go b/version.go index b4ecdafa..67254c72 100644 --- a/version.go +++ b/version.go @@ -36,7 +36,7 @@ type versionInfo struct { } func checkVersion() { - client := netutil.Client(time.Duration(15 * time.Second)) + client := netutil.Client(time.Duration(20 * time.Second)) r, err := client.PostForm(versionURL, url.Values{"current_version": {Version}}) if err != nil { @@ -66,7 +66,7 @@ func checkVersion() { return } - format := "A more recent version has been found[%s > %s].\n" + format := "A new version is available online[%s > %s].\n" if v.ChangelogURL != "" { format += "Release notes: %s\n" @@ -107,7 +107,7 @@ func checkVersion() { cmd.Stderr = os.Stdout if err := cmd.Run(); err != nil { - golog.Warnf("unexpected message while trying to go get: %v", err) + golog.Warnf("unexpected message while trying to go get,\nif you edited the original source code then you've to remove the whole $GOPATH/src/github.com/kataras folder and execute `go get github.com/kataras/iris` manually\n%v", err) return }