# std.http.Server.Request.Respond: support all transfer encodings · gitcafe/zig

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

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

Visibility: public

Requested revision: 380916c0f8883746e4d84d5334f68d0569d76f38

Requested commit: 380916c0f8883746e4d84d5334f68d0569d76f38

Commit: 380916c0f8883746e4d84d5334f68d0569d76f38

Tree: d308cd79fd6eeeb1027d82c4da0de5e88a487727

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std.http.Server.Request.Respond: support all transfer encodings

Before I mistakenly thought that missing content-length meant zero when
it actually means to stream until the connection is closed.

Now the respond() function accepts transfer_encoding which can be left
as default (use content.len for content-length), set to none which makes
it omit the content-length, or chunked, which makes it format the
response as a chunked transfer even though the server has the entire
contents already buffered.

The echo-content tests are moved from test/standalone/http.zig to the
standard library where they are actually run.

```

## Parents

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

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