Skip to content

Commit

Permalink
lib-http: Add http_client_request_retrieve_headers()
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Kenbeek authored and cmouse committed Nov 28, 2024
1 parent a88fbf1 commit 5d096d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib-http/http-client-request.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,11 @@ const char *http_client_request_lookup_header(struct http_client_request *req,
next_pos - value_pos - 2);
}

const char *http_client_request_retrieve_headers(struct http_client_request *req)
{
return str_c(req->headers);
}

void http_client_request_set_date(struct http_client_request *req, time_t date)
{
i_assert(req->state == HTTP_REQUEST_STATE_NEW ||
Expand Down
3 changes: 3 additions & 0 deletions src/lib-http/http-client.h
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,9 @@ void http_client_request_remove_header(struct http_client_request *req,
const char *http_client_request_lookup_header(struct http_client_request *req,
const char *key);

/* Retrieve the full header string of a request. */
const char *http_client_request_retrieve_headers(struct http_client_request *req);

/* Set the value of the "Date" header for the request using a time_t value.
Use this instead of setting it directly using
http_client_request_add_header() */
Expand Down

0 comments on commit 5d096d1

Please sign in to comment.