From e5b662873a6745a7e761643b1ca3d8637bf1222f Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Mon, 19 Aug 2024 09:42:00 -0700 Subject: [PATCH] omit most automatically added headers --- src/aws_http.zig | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/aws_http.zig b/src/aws_http.zig index c3a4369..a104e7e 100644 --- a/src/aws_http.zig +++ b/src/aws_http.zig @@ -190,6 +190,16 @@ pub const AwsHttp = struct { .response_storage = .{ .dynamic = &resp_payload }, .raw_uri = true, .location = .{ .url = url }, + // we need full control over most headers. I wish libraries would do a + // better job of having default headers as an opt-in... + .headers = .{ + .host = .omit, + .authorization = .omit, + .user_agent = .omit, + .connection = .default, // we can let the client manage this...it has no impact to us + .accept_encoding = .default, // accept encoding (gzip, deflate) *should* be ok + .content_type = .omit, + }, .extra_headers = headers.items, }); // TODO: Need to test for payloads > 2^14. I believe one of our tests does this, but not sure