pub struct ForgeRequest {
pub method: String,
pub path: String,
pub query: String,
pub headers: Vec<(String, String)>,
pub raw_body: Bytes,
pub host_url: Option<String>,
}Expand description
Opaque HTTP request consumed by crate::ForgeService::handle.
The caller percent-decodes path and strips the leading ? from
query before constructing this, exactly as the git crate expects.
Fields§
§method: StringUpper- or mixed-case HTTP method ("GET", "POST", "OPTIONS").
path: StringPercent-decoded URL path, including the forge prefix
("/forge/alice/repo/issues").
query: StringRaw query string with no leading ? ("state=open&page=2").
headers: Vec<(String, String)>All request headers as (name, value). Names are matched
case-insensitively.
raw_body: BytesRaw request body — kept as bytes so NIP-98 payload hashing sees the exact octets.
host_url: Option<String>Scheme + host ("https://pod.example.com"); used to reconstruct
the URL a NIP-98 u tag must match and to render absolute links.
Implementations§
Source§impl ForgeRequest
impl ForgeRequest
Sourcepub fn header(&self, name: &str) -> Option<&str>
pub fn header(&self, name: &str) -> Option<&str>
Case-insensitive header lookup returning the first match.
Sourcepub fn absolute_url(&self) -> String
pub fn absolute_url(&self) -> String
Reconstruct the canonical absolute URL (for NIP-98 u-tag checks).
Sourcepub fn query_param(&self, key: &str) -> Option<String>
pub fn query_param(&self, key: &str) -> Option<String>
Parse a single query parameter value (first occurrence),
percent-decoding + to space. Returns None when absent.
Trait Implementations§
Source§impl Clone for ForgeRequest
impl Clone for ForgeRequest
Source§fn clone(&self) -> ForgeRequest
fn clone(&self) -> ForgeRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more