Skip to content

Commit 0c2e222

Browse files
author
Loïc Hoguin
committed
Update version to 0.6.0
Also update the CHANGELOG and copyright years.
1 parent 1a1b01c commit 0c2e222

32 files changed

+163
-79
lines changed

CHANGELOG.md

+86
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,92 @@
11
CHANGELOG
22
=========
33

4+
0.6.0
5+
-----
6+
7+
* Add multipart support
8+
9+
* Add chunked transfer decoding support
10+
11+
Done by reworking the body reading API. Now all the body
12+
reading goes through the cowboy_http_req:stream_body/1
13+
function. This function takes care of handling both the
14+
Transfer-Encoding and the Content-Encoding, returning
15+
properly decoded data ready for consumption.
16+
17+
* Add fragmented websocket messages support
18+
19+
Properly tested by the addition of the Autobahn websocket
20+
test suite to our toolbox. All tests pass except a few
21+
related to UTF-8 handling, as Cowboy does no checks on that
22+
end at this point.
23+
24+
* Add 'onrequest' and 'onresponse' hooks
25+
26+
The first can be used for all the special cases you may have
27+
that can't be dealt with otherwise. It's also pretty good for
28+
writing access logs or rewriting URLs.
29+
30+
The second can be used for logging errors or replacing error
31+
pages, amongst others.
32+
33+
* Add cowboy:get_protocol_options/1 and cowboy:set_protocol_options/2
34+
35+
These functions allow for retrieving a listener's protocol options,
36+
and for modifying them while the listener is running. This is
37+
most useful to upgrade the dispatch list. The upgrade applies
38+
to all the future connections.
39+
40+
* Add the sockname/1 function to TCP and SSL transports
41+
42+
* Improve SSL transport support
43+
44+
Add support for specifying the ciphers. Add CA support. Make
45+
specifying the password optional.
46+
47+
* Add new HTTP status codes from RFC 6585
48+
49+
* Add a 'file' option to cowboy_http_static
50+
51+
This allows for mapping /folder/ paths to a /folder/index.html file.
52+
53+
* Add the '*' catch all Content-Type for REST
54+
55+
* Add {halt, Req, State} as a possible return value for REST
56+
57+
* Add absolute URI support for requests
58+
59+
* Add cowboy_http:x_www_form_urlencoded/2
60+
61+
* Various REST bug fixes
62+
63+
* Do not send chunked replies for HTTP/1.0 connections
64+
65+
* Fix a DST bug in the cookies code
66+
67+
* Fix a bug with setting cookie values containing slashes
68+
69+
* Fix a small timer leak when using loop/websocket timeouts
70+
71+
* Make charset and media type parsing more relaxed
72+
73+
This is to accomodate some widely used broken clients.
74+
75+
* Make error messages more readable
76+
77+
* Fix and improve type specifications
78+
79+
* Fix a bug preventing documentation from being generated
80+
81+
* Small improvements to the documentation
82+
83+
* Rework the HTTP test suite
84+
85+
The suite now uses an integrated Cowboy HTTP client. The client
86+
is currently experimental and shouldn't be used.
87+
88+
* Add many many tests.
89+
490
0.4.0
591
-----
692

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
1+
Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
22

33
Permission to use, copy, modify, and/or distribute this software for any
44
purpose with or without fee is hereby granted, provided that the above

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -157,28 +157,28 @@ based on the hostname and path information from the request. It also lets
157157
you define static options for the handler directly in the rules.
158158

159159
To match the hostname and path, Cowboy requires a list of tokens. For
160-
example, to match the "dev-extend.eu" domain name, you must specify
161-
`[<<"dev-extend">>, <<"eu">>]`. Or, to match the "/path/to/my/resource"
160+
example, to match the "ninenines.eu" domain name, you must specify
161+
`[<<"ninenines">>, <<"eu">>]`. Or, to match the "/path/to/my/resource"
162162
you must use `[<<"path">>, <<"to">>, <<"my">>, <<"resource">>]`. All the
163163
tokens must be given as binary.
164164

165165
You can use the special token `'_'` (the atom underscore) to indicate that
166166
you accept anything in that position. For example if you have both
167-
"dev-extend.eu" and "dev-extend.fr" domains, you can use the match spec
168-
`[<<"dev-extend">>, '_']` to match any top level extension.
167+
"ninenines.eu" and "ninenines.fr" domains, you can use the match spec
168+
`[<<"ninenines">>, '_']` to match any top level extension.
169169

170170
Finally, you can also match multiple leading segments of the domain name and
171171
multiple trailing segments of the request path using the atom `'...'` (the atom
172172
ellipsis) respectively as the first host token or the last path token. For
173-
example, host rule `['...', <<"dev-extend">>, <<"eu">>]` can match both
174-
"cowboy.bugs.dev-extend.eu" and "dev-extend.eu" and path rule
173+
example, host rule `['...', <<"ninenines">>, <<"eu">>]` can match both
174+
"cowboy.bugs.ninenines.eu" and "ninenines.eu" and path rule
175175
`[<<"projects">>, '...']` can match both "/projects" and
176176
"/projects/cowboy/issues/42". The host leading segments and the path trailing
177177
segments can later be retrieved through `cowboy_http_req:host_info/1` and
178178
`cowboy_http_req:path_info/1`.
179179

180180
Any other atom used as a token will bind the value to this atom when
181-
matching. To follow on our hostnames example, `[<<"dev-extend">>, ext]`
181+
matching. To follow on our hostnames example, `[<<"ninenines">>, ext]`
182182
would bind the values `<<"eu">>` and `<<"fr">>` to the ext atom, that you
183183
can later retrieve in your handler by calling `cowboy_http_req:binding/{2,3}`.
184184

ROADMAP.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,12 @@ are not ordered.
6161
Tools like curl expect a 100 Continue before sending a
6262
request body by default.
6363

64-
* Convert the multipart code to stream_body.
65-
6664
* Complete the work on Websockets.
6765

6866
Now that the Autobahn test suite is available (make inttests),
6967
we have a definite way to know whether Cowboy's implementation
7068
of Websockets is right. The work can thus be completed. The
71-
remaining tasks are proper UTF8 handling.
69+
remaining task is proper UTF8 handling.
7270

7371
* SPDY support.
7472

doc/overview.edoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@author Lo�c Hoguin <essen@dev-extend.eu>
2-
@copyright 2011 Lo�c Hoguin
1+
@author Lo�c Hoguin <essen@ninenines.eu>
2+
@copyright 2011-2012 Lo�c Hoguin
33
@version HEAD
44
@title Small, fast, modular HTTP server.

include/http.hrl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
1+
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
22
%% Copyright (c) 2011, Anthony Ramine <[email protected]>
33
%%
44
%% Permission to use, copy, modify, and/or distribute this software for any

src/cowboy.app.src

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
1+
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
22
%%
33
%% Permission to use, copy, modify, and/or distribute this software for any
44
%% purpose with or without fee is hereby granted, provided that the above
@@ -14,7 +14,7 @@
1414

1515
{application, cowboy, [
1616
{description, "Small, fast, modular HTTP server."},
17-
{vsn, "0.5.0"},
17+
{vsn, "0.6.0"},
1818
{modules, []},
1919
{registered, [cowboy_clock, cowboy_sup]},
2020
{applications, [

src/cowboy.erl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
1+
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
22
%%
33
%% Permission to use, copy, modify, and/or distribute this software for any
44
%% purpose with or without fee is hereby granted, provided that the above

src/cowboy_acceptor.erl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
1+
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
22
%%
33
%% Permission to use, copy, modify, and/or distribute this software for any
44
%% purpose with or without fee is hereby granted, provided that the above

src/cowboy_acceptors_sup.erl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
1+
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
22
%%
33
%% Permission to use, copy, modify, and/or distribute this software for any
44
%% purpose with or without fee is hereby granted, provided that the above

src/cowboy_app.erl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
1+
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
22
%%
33
%% Permission to use, copy, modify, and/or distribute this software for any
44
%% purpose with or without fee is hereby granted, provided that the above

src/cowboy_bstr.erl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
1+
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
22
%%
33
%% Permission to use, copy, modify, and/or distribute this software for any
44
%% purpose with or without fee is hereby granted, provided that the above

src/cowboy_clock.erl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
1+
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
22
%%
33
%% Permission to use, copy, modify, and/or distribute this software for any
44
%% purpose with or without fee is hereby granted, provided that the above

src/cowboy_dispatcher.erl

+38-38
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
1+
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
22
%% Copyright (c) 2011, Anthony Ramine <[email protected]>
33
%%
44
%% Permission to use, copy, modify, and/or distribute this software for any
@@ -85,8 +85,8 @@ do_split_path(RawPath, Separator, URLDec) ->
8585
%% corresponding token value and return it.
8686
%%
8787
%% The list of hostname tokens is reversed before matching. For example, if
88-
%% we were to match "www.dev-extend.eu", we would first match "eu", then
89-
%% "dev-extend", then "www". This means that in the context of hostnames,
88+
%% we were to match "www.ninenines.eu", we would first match "eu", then
89+
%% "ninenines", then "www". This means that in the context of hostnames,
9090
%% the <em>'...'</em> atom matches properly the lower levels of the domain
9191
%% as would be expected.
9292
%%
@@ -173,16 +173,16 @@ split_host_test_() ->
173173
{<<"">>, {[], <<"">>, undefined}},
174174
{<<".........">>, {[], <<".........">>, undefined}},
175175
{<<"*">>, {[<<"*">>], <<"*">>, undefined}},
176-
{<<"cowboy.dev-extend.eu">>,
177-
{[<<"cowboy">>, <<"dev-extend">>, <<"eu">>],
178-
<<"cowboy.dev-extend.eu">>, undefined}},
179-
{<<"dev-extend..eu">>,
180-
{[<<"dev-extend">>, <<>>, <<"eu">>],
181-
<<"dev-extend..eu">>, undefined}},
182-
{<<"dev-extend.eu">>,
183-
{[<<"dev-extend">>, <<"eu">>], <<"dev-extend.eu">>, undefined}},
184-
{<<"dev-extend.eu:8080">>,
185-
{[<<"dev-extend">>, <<"eu">>], <<"dev-extend.eu">>, 8080}},
176+
{<<"cowboy.ninenines.eu">>,
177+
{[<<"cowboy">>, <<"ninenines">>, <<"eu">>],
178+
<<"cowboy.ninenines.eu">>, undefined}},
179+
{<<"ninenines..eu">>,
180+
{[<<"ninenines">>, <<>>, <<"eu">>],
181+
<<"ninenines..eu">>, undefined}},
182+
{<<"ninenines.eu">>,
183+
{[<<"ninenines">>, <<"eu">>], <<"ninenines.eu">>, undefined}},
184+
{<<"ninenines.eu:8080">>,
185+
{[<<"ninenines">>, <<"eu">>], <<"ninenines.eu">>, 8080}},
186186
{<<"a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z">>,
187187
{[<<"a">>, <<"b">>, <<"c">>, <<"d">>, <<"e">>, <<"f">>, <<"g">>,
188188
<<"h">>, <<"i">>, <<"j">>, <<"k">>, <<"l">>, <<"m">>, <<"n">>,
@@ -195,13 +195,13 @@ split_host_test_() ->
195195

196196
split_host_fail_test_() ->
197197
Tests = [
198-
<<"dev-extend.eu:owns">>,
199-
<<"dev-extend.eu: owns">>,
200-
<<"dev-extend.eu:42fun">>,
201-
<<"dev-extend.eu: 42fun">>,
202-
<<"dev-extend.eu:42 fun">>,
203-
<<"dev-extend.eu:fun 42">>,
204-
<<"dev-extend.eu: 42">>,
198+
<<"ninenines.eu:owns">>,
199+
<<"ninenines.eu: owns">>,
200+
<<"ninenines.eu:42fun">>,
201+
<<"ninenines.eu: 42fun">>,
202+
<<"ninenines.eu:42 fun">>,
203+
<<"ninenines.eu:fun 42">>,
204+
<<"ninenines.eu: 42">>,
205205
<<":owns">>,
206206
<<":42 fun">>
207207
],
@@ -233,14 +233,14 @@ split_path_test_() ->
233233

234234
match_test_() ->
235235
Dispatch = [
236-
{[<<"www">>, '_', <<"dev-extend">>, <<"eu">>], [
236+
{[<<"www">>, '_', <<"ninenines">>, <<"eu">>], [
237237
{[<<"users">>, '_', <<"mails">>], match_any_subdomain_users, []}
238238
]},
239-
{[<<"dev-extend">>, <<"eu">>], [
239+
{[<<"ninenines">>, <<"eu">>], [
240240
{[<<"users">>, id, <<"friends">>], match_extend_users_friends, []},
241241
{'_', match_extend, []}
242242
]},
243-
{[<<"dev-extend">>, var], [
243+
{[<<"ninenines">>, var], [
244244
{[<<"threads">>, var], match_duplicate_vars,
245245
[we, {expect, two}, var, here]}
246246
]},
@@ -255,22 +255,22 @@ match_test_() ->
255255
%% {Host, Path, Result}
256256
Tests = [
257257
{[<<"any">>], [], {ok, match_any, [], []}},
258-
{[<<"www">>, <<"any">>, <<"dev-extend">>, <<"eu">>],
258+
{[<<"www">>, <<"any">>, <<"ninenines">>, <<"eu">>],
259259
[<<"users">>, <<"42">>, <<"mails">>],
260260
{ok, match_any_subdomain_users, [], []}},
261-
{[<<"www">>, <<"dev-extend">>, <<"eu">>],
261+
{[<<"www">>, <<"ninenines">>, <<"eu">>],
262262
[<<"users">>, <<"42">>, <<"mails">>], {ok, match_any, [], []}},
263-
{[<<"www">>, <<"dev-extend">>, <<"eu">>], [], {ok, match_any, [], []}},
264-
{[<<"www">>, <<"any">>, <<"dev-extend">>, <<"eu">>],
263+
{[<<"www">>, <<"ninenines">>, <<"eu">>], [], {ok, match_any, [], []}},
264+
{[<<"www">>, <<"any">>, <<"ninenines">>, <<"eu">>],
265265
[<<"not_users">>, <<"42">>, <<"mails">>], {error, notfound, path}},
266-
{[<<"dev-extend">>, <<"eu">>], [], {ok, match_extend, [], []}},
267-
{[<<"dev-extend">>, <<"eu">>], [<<"users">>, <<"42">>, <<"friends">>],
266+
{[<<"ninenines">>, <<"eu">>], [], {ok, match_extend, [], []}},
267+
{[<<"ninenines">>, <<"eu">>], [<<"users">>, <<"42">>, <<"friends">>],
268268
{ok, match_extend_users_friends, [], [{id, <<"42">>}]}},
269269
{[<<"erlang">>, <<"fr">>], '_',
270270
{ok, match_erlang_ext, [], [{ext, <<"fr">>}]}},
271271
{[<<"any">>], [<<"users">>, <<"444">>, <<"friends">>],
272272
{ok, match_users_friends, [], [{id, <<"444">>}]}},
273-
{[<<"dev-extend">>, <<"fr">>], [<<"threads">>, <<"987">>],
273+
{[<<"ninenines">>, <<"fr">>], [<<"threads">>, <<"987">>],
274274
{ok, match_duplicate_vars, [we, {expect, two}, var, here],
275275
[{var, <<"fr">>}, {var, <<"987">>}]}}
276276
],
@@ -280,27 +280,27 @@ match_test_() ->
280280

281281
match_info_test_() ->
282282
Dispatch = [
283-
{[<<"www">>, <<"dev-extend">>, <<"eu">>], [
283+
{[<<"www">>, <<"ninenines">>, <<"eu">>], [
284284
{[<<"pathinfo">>, <<"is">>, <<"next">>, '...'], match_path, []}
285285
]},
286-
{['...', <<"dev-extend">>, <<"eu">>], [
286+
{['...', <<"ninenines">>, <<"eu">>], [
287287
{'_', match_any, []}
288288
]}
289289
],
290290
Tests = [
291-
{[<<"dev-extend">>, <<"eu">>], [],
291+
{[<<"ninenines">>, <<"eu">>], [],
292292
{ok, match_any, [], [], [], undefined}},
293-
{[<<"bugs">>, <<"dev-extend">>, <<"eu">>], [],
293+
{[<<"bugs">>, <<"ninenines">>, <<"eu">>], [],
294294
{ok, match_any, [], [], [<<"bugs">>], undefined}},
295-
{[<<"cowboy">>, <<"bugs">>, <<"dev-extend">>, <<"eu">>], [],
295+
{[<<"cowboy">>, <<"bugs">>, <<"ninenines">>, <<"eu">>], [],
296296
{ok, match_any, [], [], [<<"cowboy">>, <<"bugs">>], undefined}},
297-
{[<<"www">>, <<"dev-extend">>, <<"eu">>],
297+
{[<<"www">>, <<"ninenines">>, <<"eu">>],
298298
[<<"pathinfo">>, <<"is">>, <<"next">>],
299299
{ok, match_path, [], [], undefined, []}},
300-
{[<<"www">>, <<"dev-extend">>, <<"eu">>],
300+
{[<<"www">>, <<"ninenines">>, <<"eu">>],
301301
[<<"pathinfo">>, <<"is">>, <<"next">>, <<"path_info">>],
302302
{ok, match_path, [], [], undefined, [<<"path_info">>]}},
303-
{[<<"www">>, <<"dev-extend">>, <<"eu">>],
303+
{[<<"www">>, <<"ninenines">>, <<"eu">>],
304304
[<<"pathinfo">>, <<"is">>, <<"next">>, <<"foo">>, <<"bar">>],
305305
{ok, match_path, [], [], undefined, [<<"foo">>, <<"bar">>]}}
306306
],

src/cowboy_http.erl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
1+
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
22
%% Copyright (c) 2011, Anthony Ramine <[email protected]>
33
%%
44
%% Permission to use, copy, modify, and/or distribute this software for any

src/cowboy_http_handler.erl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
1+
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
22
%%
33
%% Permission to use, copy, modify, and/or distribute this software for any
44
%% purpose with or without fee is hereby granted, provided that the above

src/cowboy_http_protocol.erl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
1+
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
22
%% Copyright (c) 2011, Anthony Ramine <[email protected]>
33
%%
44
%% Permission to use, copy, modify, and/or distribute this software for any

src/cowboy_http_req.erl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
1+
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
22
%% Copyright (c) 2011, Anthony Ramine <[email protected]>
33
%%
44
%% Permission to use, copy, modify, and/or distribute this software for any

src/cowboy_http_rest.erl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
1+
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
22
%%
33
%% Permission to use, copy, modify, and/or distribute this software for any
44
%% purpose with or without fee is hereby granted, provided that the above

src/cowboy_http_websocket.erl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
1+
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
22
%%
33
%% Permission to use, copy, modify, and/or distribute this software for any
44
%% purpose with or without fee is hereby granted, provided that the above

0 commit comments

Comments
 (0)