Skip to main content

origin_matches

Function origin_matches 

Source
fn origin_matches(trusted: Option<&str>, incoming: Option<&str>) -> bool
Expand description

判断写请求的来源是否可信。

cookie-auth 写请求必须同时拥有可确定的本站 origin 与来源头; 任一缺失都拒绝,避免 Origin/Referer 被剥离时形成 CSRF fail-open。