# std.http: Always initialize \`response.headers\` in Client.request · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/0488c3cb52a75ffa4fa73b385d3d6e79cc6da774)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 0488c3cb52a75ffa4fa73b385d3d6e79cc6da774

Requested commit: 0488c3cb52a75ffa4fa73b385d3d6e79cc6da774

Commit: 0488c3cb52a75ffa4fa73b385d3d6e79cc6da774

Tree: 66f847c3dd9f89b5af9b518b2269feecfdbe47c4

Author: Ryan Liptak

Committer: Ryan Liptak

## Message

```
std.http: Always initialize `response.headers` in Client.request

Before this change, if a request errored before getting its `response.headers` initialized, then it would attempt to `deinit` `response.headers` which would still be `undefined`. Since all locations that set `response.headers` use the same code, it can just be done upfront in `request` instead.

Closes #15380

```

## Parents

- [1acb3162b7e24e6badad4aff37dbeac09f47f165](https://git.cafe/gitcafe/zig/commit/1acb3162b7e24e6badad4aff37dbeac09f47f165?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/0488c3cb52a75ffa4fa73b385d3d6e79cc6da774?format=markdown)
