Skip to content

Commit

Permalink
Make X-Vault-Request a default header
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrienneCohea committed Nov 11, 2023
1 parent 42c2257 commit c02ff1d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ impl MiddleWare for EndpointMiddleware {
*req.uri_mut() = http::Uri::from_str(url_c.as_str()).unwrap();
debug!("Middleware: final URL is {}", url_c.as_str());

// Add X-Vault-Request to all requests
req.headers_mut().append(
"X-Vault-Request",
http::HeaderValue::from_str("true").unwrap(),
);

// Add Vault token to all requests
if !self.token.is_empty() {
debug!("Middleware: adding token to header");
Expand Down

0 comments on commit c02ff1d

Please sign in to comment.