pub struct HttpRequest {Show 14 fields
pub method: String,
pub path: String,
pub query: String,
pub body: Vec<u8>,
pub git_protocol: Option<String>,
pub authorization: Option<String>,
pub destination: Option<String>,
pub lock_token: Option<String>,
pub host: Option<String>,
pub cookie: Option<String>,
pub origin: Option<String>,
pub forwarded_proto: Option<String>,
pub sec_fetch_site: Option<String>,
pub headers: Vec<(String, String)>,
}Fields§
§method: String§path: String§query: String§body: Vec<u8>§git_protocol: Option<String>Raw Git-Protocol header value (e.g. version=2), if present.
Raw Authorization header value (e.g. Basic …), if present.
destination: Option<String>WebDAV Destination header (MOVE).
lock_token: Option<String>WebDAV lock token from Lock-Token or If header.
host: Option<String>Raw Host header (for LFS batch href construction).
Raw Cookie header (for self-hosted Web UI session authentication).
origin: Option<String>Raw Origin header (for cross-site POST CSRF protection).
forwarded_proto: Option<String>Effective scheme (https when served over TLS or X-Forwarded-Proto: https).
sec_fetch_site: Option<String>Raw Sec-Fetch-Site header (for cross-site mutation CSRF defense when Origin is absent).
headers: Vec<(String, String)>Case-insensitive HTTP request headers (HX-Request, HX-Boosted, HX-Target,
If-None-Match, Accept, X-CSRF-Token, etc.).
Implementations§
Source§impl HttpRequest
impl HttpRequest
pub fn new( method: impl Into<String>, path: impl Into<String>, query: impl Into<String>, body: Vec<u8>, ) -> Self
Sourcepub fn client_ip(&self) -> Option<&str>
pub fn client_ip(&self) -> Option<&str>
Effective client IP resolved by arks serve after trusted-proxy CIDR checks (O-5).
Sourcepub fn with_header(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_header( self, name: impl Into<String>, value: impl Into<String>, ) -> Self
Builder helper to attach an HTTP header (name normalized to ASCII lowercase).