fix readability edge case
This commit is contained in:
parent
56e5625adc
commit
e62906e63d
3 changed files with 8 additions and 2 deletions
|
|
@ -474,8 +474,9 @@ func (s *Server) handlePageCrawl(c *router.Context) {
|
|||
}
|
||||
content, err := readability.ExtractContent(strings.NewReader(body))
|
||||
if err != nil {
|
||||
log.Print(err)
|
||||
c.Out.WriteHeader(http.StatusNoContent)
|
||||
c.JSON(http.StatusOK, map[string]string{
|
||||
"content": "error: " + err.Error(),
|
||||
})
|
||||
return
|
||||
}
|
||||
content = sanitizer.Sanitize(url, content)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue