fix encoding
This commit is contained in:
parent
e3e9542f1e
commit
52cc8ecbbd
4 changed files with 75 additions and 45 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue