Skip to main content

normalize_origin

Function normalize_origin 

Source
fn normalize_origin(input: &str) -> String
Expand description

scheme://host[:port][/path][?query] 提取标准化的 scheme://host[:port], 端口为默认值(http=80, https=443)时省略。

不引入 url crate:Origin 头本身就是 scheme://host[:port](无路径), Referer 需要剥离 path/query,用简单的 split 即可。