Request: Add additional method support for auth/unauth requests

This commit is contained in:
Adrian Gallagher
2018-03-29 15:46:47 +11:00
parent 5f25fd8be7
commit c7774708cd

View File

@@ -193,11 +193,19 @@ func (h *Handler) requestWorker() {
if job.Auth {
<-h.timeLockAuth
httpResponse, err = h.Client.Do(job.Request)
if job.Request.Method != "GET" {
httpResponse, err = h.Client.Do(job.Request)
} else {
httpResponse, err = h.Client.Get(job.Path)
}
h.timeLockAuth <- 1
} else {
<-h.timeLock
httpResponse, err = h.Client.Get(job.Path)
if job.Request.Method != "GET" {
httpResponse, err = h.Client.Do(job.Request)
} else {
httpResponse, err = h.Client.Get(job.Path)
}
h.timeLock <- 1
}