mirror of https://github.com/usememos/memos.git
fix limit html meta response body size
This commit is contained in:
parent
2327f4e3a6
commit
3f9b5f2c8f
|
|
@ -51,9 +51,8 @@ func GetHTMLMeta(urlStr string) (*HTMLMeta, error) {
|
|||
return nil, errors.New("not a HTML page")
|
||||
}
|
||||
|
||||
// TODO: limit the size of the response body
|
||||
|
||||
htmlMeta := extractHTMLMeta(response.Body)
|
||||
reader := io.LimitReader(response.Body, 1<<20) // 1 MB max
|
||||
htmlMeta := extractHTMLMeta(reader)
|
||||
enrichSiteMeta(response.Request.URL, htmlMeta)
|
||||
return htmlMeta, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue