/remove on pool server is now a redirect
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
f2290a17b4
commit
4cee28b8bb
|
@ -9,7 +9,6 @@ import (
|
|||
encode_utils "git.gammaspectra.live/S.O.N.G/Ignite/cli/encode-utils"
|
||||
"gopkg.in/yaml.v3"
|
||||
"io"
|
||||
"maps"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
|
@ -237,20 +236,9 @@ func main() {
|
|||
w.WriteHeader(http.StatusNotFound)
|
||||
return
|
||||
} else {
|
||||
jobs = slices.Delete(jobs, i, i+1)
|
||||
job := jobs[i]
|
||||
response, err := job.Server.Pass(r, [2]string{"k", job.Server.Key}, [2]string{"jobId", job.ServerId})
|
||||
defer response.Body.Close()
|
||||
defer io.ReadAll(response.Body)
|
||||
if err != nil {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
if response.StatusCode == http.StatusOK {
|
||||
jobs = slices.Delete(jobs, i, i+1)
|
||||
}
|
||||
maps.Copy(w.Header(), response.Header)
|
||||
w.WriteHeader(response.StatusCode)
|
||||
_, _ = io.Copy(w, response.Body)
|
||||
job.Server.Redirect(w, r, [2]string{"k", job.Server.Key}, [2]string{"jobId", job.ServerId})
|
||||
}
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue