From d350e8ccd9da4762d63835201c0dac6f8d76bcfe Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sun, 12 Feb 2023 12:21:03 +0100 Subject: [PATCH] s/client_add_header/client_default_header/ --- net/http/client.ha | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/net/http/client.ha b/net/http/client.ha index 42d1582..c88e54c 100644 --- a/net/http/client.ha +++ b/net/http/client.ha @@ -23,10 +23,11 @@ export fn client_finish(client: *client) void = { header_free(&client.default_header); }; -// Adds a default header which is included on all HTTP requests using a given -// [[client]]. -export fn client_add_header(client: *client, name: str, val: str) void = { - header_add(&client.default_header, name, val); +// Returns the default headers used by this HTTP client, so that the user can +// examine or modify the net::http defaults (such as User-Agent or +// Accept-Encoding), or add their own. +export fn client_default_header(client: *client) *header = { + return &client.default_header; }; fn new_request(client: *client, method: str, target: *uri::uri) request = {