# std.http: parser fixes · gitcafe/zig

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

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

Visibility: public

Requested revision: 78192637fba21c1cc6fca364be716795e4e44020

Requested commit: 78192637fba21c1cc6fca364be716795e4e44020

Commit: 78192637fba21c1cc6fca364be716795e4e44020

Tree: c8cd4fd1f06505cb49750a7893b216d1f26575e0

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std.http: parser fixes

* add API for iterating over custom HTTP headers
* remove `trailing` flag from std.http.Client.parse. Instead, simply
  don't call parse() for trailers.
* fix the logic inside that parse() function. it was using wrong std.mem
  functions, ignoring malformed data, and returned errors on dead
  branches.
* simplify logic inside wait()
* fix HeadersParser not dropping the 2 read bytes of \r\n after a
  chunked transfer
* move the trailers test to be a std lib unit test and make it pass

```

## Parents

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

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