summaryrefslogtreecommitdiffstats
path: root/_build/content/articles/cowboy-2.5.0.asciidoc
blob: f0e45bff7754186338e3eb433b481868e92990a1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
+++
date = "2018-10-03T07:00:00+01:00"
title = "Cowboy 2.5"

+++

Cowboy `2.5.0` has been released!

Cowboy 2.5 focused on making the test suites pass.
It is now possible to get all the Cowboy tests to
pass successfully, at least on Linux and on the
more recent Erlang/OTP versions.

HTTP/1.1 has been improved with a fix for the TCP
reset problem and the ability to stream a response
body without using chunked transfer-encoding.

Two functions have been added: `cowboy_req:stream_events/3`
encodes and streams one or more text/event-stream events,
and `cowboy_req:read_and_match_urlencoded_body/2,3` reads,
parses and matches application/x-www-form-urlencoded
request bodies. I'm not a fan of the long name, or the fact
it does so many things at the same time, but its usefulness
is undeniable.

The more interesting new features are experimental.

A new interface has been added to Websocket handlers
that allows for greater extensibility. It changes the
return values from a number of different tuples to
a list of commands (similar to stream handlers or
to `gen_statem`). A new command has been introduced
that tells Cowboy to stop/resume reading from the
socket.

A `logger` option has been added to define which
logger module shall be used. It defaults to
`error_logger` but can be configured to Erlang/OTP 21's
new `logger` module, the widely used `lager` or
any module compatible with the `logger` module
interface. In addition a `log` stream handler
command has been added, allowing stream handlers
to silence certain log messages if necessary.

Many bugs have also been fixed.

A complete
list of changes can be found in the migration guide:
https://ninenines.eu/docs/en/cowboy/2.5/guide/migrating_from_2.4/[Migrating from Cowboy 2.4 to 2.5].

You can donate to this project via
https://github.com/sponsors/essen[GitHub Sponsors].
These funds are used to pay for additional servers for
testing.

As usual, feedback is appreciated, and issues or
questions should be sent via Github tickets. Thanks!