fix encoding

This commit is contained in:
nkanaev
2022-01-24 16:47:32 +00:00
parent e3e9542f1e
commit 52cc8ecbbd
4 changed files with 75 additions and 45 deletions

View File

@@ -457,14 +457,13 @@ func (s *Server) handlePageCrawl(c *router.Context) {
return
}
res, err := worker.GetHTTP(url)
body, err := worker.GetBody(url)
if err != nil {
log.Print(err)
c.Out.WriteHeader(http.StatusBadRequest)
return
}
defer res.Body.Close()
content, err := readability.ExtractContent(res.Body)
content, err := readability.ExtractContent(strings.NewReader(body))
if err != nil {
log.Print(err)
c.Out.WriteHeader(http.StatusNoContent)