Skip to content

Commit

Permalink
feat: add headers() function
Browse files Browse the repository at this point in the history
Returns a reference to the list of headers

Signed-off-by: Nils Ponsard <[email protected]>
  • Loading branch information
nponsard committed Nov 20, 2023
1 parent 260213b commit 0172c83
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ impl Response {
.map(|h| h.name().to_lowercase())
.collect()
}

/// A reference to the list of headers in the response.
pub fn headers(&self) -> &Vec<Header> {
self.headers.as_ref()
}

/// Tells if the response has the named header.
pub fn has(&self, name: &str) -> bool {
Expand Down

0 comments on commit 0172c83

Please sign in to comment.