fix(CapSolver): separate CapSolver api from AntiGateV2
All checks were successful
release-tag / release (push) Successful in 1m53s
All checks were successful
release-tag / release (push) Successful in 1m53s
This commit is contained in:
@ -23,10 +23,7 @@ func (a *antigateV2Api) Name() string {
|
||||
}
|
||||
|
||||
func (a *antigateV2Api) Domains() []string {
|
||||
return []string{
|
||||
"api.anti-captcha.com",
|
||||
"api.capsolver.com",
|
||||
}
|
||||
return []string{"api.anti-captcha.com"}
|
||||
}
|
||||
|
||||
func (a *antigateV2Api) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
@ -244,6 +241,11 @@ func jsonHandler[T any](api *antigateV2Api, handler func(data T) any) func(http.
|
||||
api.ctx.Logger.WithFields(logrus.Fields{"handler": api.Name(), "response": response}).Debug("response")
|
||||
|
||||
marshaled, _ := json.Marshal(response)
|
||||
|
||||
if _, ok := response.(*antigateError); ok {
|
||||
w.WriteHeader(400)
|
||||
}
|
||||
|
||||
w.Write(marshaled)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user