Skip to main content

PREFIX

Constant PREFIX 

Source
pub const PREFIX: &str = "/api/v2";
Expand description

Path prefix every v2 endpoint lives under.

Hosts pass this to CsrfConfig::exempt_prefix. Apart from the credential-based member login, the API registers only GET, so there is no cookie-authenticated write for CSRF to protect. Without the exemption the layer rejects unsafe verbs before routing, and a client attempting a write is told 403 Forbidden rather than 405 Method Not Allowed: it goes looking for a permissions problem instead of concluding the endpoint does not exist.