Skip to main content

MAX_PER_PAGE

Constant MAX_PER_PAGE 

Source
const MAX_PER_PAGE: i32 = 50;
Expand description

单页允许的最大文章数。

公开的 list_published_posts 接口无需认证,若不对 per_page 设上限, 攻击者可传入巨大值迫使数据库扫描并实例化超大 Vec,造成内存放大与拒绝服务。