diff options
| author | Jeff Carr <[email protected]> | 2025-08-22 01:44:16 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-08-22 01:44:16 -0500 |
| commit | 0539e2feee23adc0be8a88e1c6dc214cc7d98de5 (patch) | |
| tree | a6187bd1751591716eae4d1d3bc1d009fada6cbc /patchset.Send.go | |
| parent | 473cf6f9addfe34c1a43b56432f15f921b397007 (diff) | |
detect cloudflare human checkv0.0.117
Diffstat (limited to 'patchset.Send.go')
| -rw-r--r-- | patchset.Send.go | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/patchset.Send.go b/patchset.Send.go index f65d367..934b5c0 100644 --- a/patchset.Send.go +++ b/patchset.Send.go @@ -5,6 +5,7 @@ package forgepb import ( "errors" + "strings" "time" "go.wit.com/log" @@ -62,12 +63,17 @@ func (f *Forge) submitPatchset(pset *Patchset) error { newpb := NewPatches() if err := newpb.Unmarshal(body); err != nil { - log.Infof("forged DID NOT SEND BACK PROTOBUF len(body)=%d %s (TODO: look for failure on cloudflare 'is human' check here)\n", len(body), body[0:100]) - log.Infof("TODO: try to identify data here len(body)=%d body[0:40]=%s\n", len(body), body[0:40]) - log.Info("BODY START:", body[0:10], string(body[0:10])) - log.Info(string(body)) - if err := newpb.UnmarshalTEXT(body[2:]); err == nil { - log.Info("wow, that did work. newpb.Len() =", newpb.Len()) + cfcheck := string(body[0:100]) + if strings.Contains(cfcheck, "<title>Just a moment...</title>") { + return log.Errorf("Cloudflare throttled this attempt to submit. TODO: fix this") + } else { + log.Infof("forged DID NOT SEND BACK PROTOBUF len(body)=%d %s (TODO: look for failure on cloudflare 'is human' check here)\n", len(body), body[0:100]) + // log.Infof("TODO: try to identify data here len(body)=%d body[0:40]=%s\n", len(body), body[0:40]) + // log.Info("BODY START:", body[0:10], string(body[0:10])) + // log.Info(string(body)) + // if err := newpb.UnmarshalTEXT(body[2:]); err == nil { + // log.Info("wow, that did work. newpb.Len() =", newpb.Len()) + // } } return err } |
