Skip to main content

github_headers

Function github_headers 

Source
pub fn github_headers(token: &str) -> Result<HeaderMap, RsGuardError>
Expand description

Builds default headers for GitHub API requests.

Includes Authorization, Accept, X-GitHub-Api-Version, and User-Agent headers. The User-Agent is derived from CARGO_PKG_NAME/CARGO_PKG_VERSION at compile time.

ยงErrors

Returns RsGuardError::Config if the token contains invalid header characters.