if parse script to redir, then return no auth

master v0.4.1
Bel LaPointe 2022-01-27 15:37:58 -07:00
parent 0ab4b795bd
commit d7339c855e
1 changed files with 3 additions and 0 deletions

View File

@ -158,6 +158,9 @@ func (fe FastExact) parse(resp *http.Response) ([]Job, error) {
} }
b, _ = ioutil.ReadAll(gzip) b, _ = ioutil.ReadAll(gzip)
} }
if bytes.Contains(b, []byte(`<script>window.location.href='index.php'</script>`)) {
return nil, ErrNoAuth
}
logtr.Verbosef("fe.parse %s", b) logtr.Verbosef("fe.parse %s", b)
resp.Body = io.NopCloser(bytes.NewReader(b)) resp.Body = io.NopCloser(bytes.NewReader(b))
doc, err := goquery.NewDocumentFromReader(resp.Body) doc, err := goquery.NewDocumentFromReader(resp.Body)