mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Update version to 0.6.0
Also update the CHANGELOG and copyright years.
This commit is contained in:
parent
1a1b01c7c4
commit
0c2e2224e3
32 changed files with 163 additions and 79 deletions
86
CHANGELOG.md
86
CHANGELOG.md
|
@ -1,6 +1,92 @@
|
||||||
CHANGELOG
|
CHANGELOG
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
0.6.0
|
||||||
|
-----
|
||||||
|
|
||||||
|
* Add multipart support
|
||||||
|
|
||||||
|
* Add chunked transfer decoding support
|
||||||
|
|
||||||
|
Done by reworking the body reading API. Now all the body
|
||||||
|
reading goes through the cowboy_http_req:stream_body/1
|
||||||
|
function. This function takes care of handling both the
|
||||||
|
Transfer-Encoding and the Content-Encoding, returning
|
||||||
|
properly decoded data ready for consumption.
|
||||||
|
|
||||||
|
* Add fragmented websocket messages support
|
||||||
|
|
||||||
|
Properly tested by the addition of the Autobahn websocket
|
||||||
|
test suite to our toolbox. All tests pass except a few
|
||||||
|
related to UTF-8 handling, as Cowboy does no checks on that
|
||||||
|
end at this point.
|
||||||
|
|
||||||
|
* Add 'onrequest' and 'onresponse' hooks
|
||||||
|
|
||||||
|
The first can be used for all the special cases you may have
|
||||||
|
that can't be dealt with otherwise. It's also pretty good for
|
||||||
|
writing access logs or rewriting URLs.
|
||||||
|
|
||||||
|
The second can be used for logging errors or replacing error
|
||||||
|
pages, amongst others.
|
||||||
|
|
||||||
|
* Add cowboy:get_protocol_options/1 and cowboy:set_protocol_options/2
|
||||||
|
|
||||||
|
These functions allow for retrieving a listener's protocol options,
|
||||||
|
and for modifying them while the listener is running. This is
|
||||||
|
most useful to upgrade the dispatch list. The upgrade applies
|
||||||
|
to all the future connections.
|
||||||
|
|
||||||
|
* Add the sockname/1 function to TCP and SSL transports
|
||||||
|
|
||||||
|
* Improve SSL transport support
|
||||||
|
|
||||||
|
Add support for specifying the ciphers. Add CA support. Make
|
||||||
|
specifying the password optional.
|
||||||
|
|
||||||
|
* Add new HTTP status codes from RFC 6585
|
||||||
|
|
||||||
|
* Add a 'file' option to cowboy_http_static
|
||||||
|
|
||||||
|
This allows for mapping /folder/ paths to a /folder/index.html file.
|
||||||
|
|
||||||
|
* Add the '*' catch all Content-Type for REST
|
||||||
|
|
||||||
|
* Add {halt, Req, State} as a possible return value for REST
|
||||||
|
|
||||||
|
* Add absolute URI support for requests
|
||||||
|
|
||||||
|
* Add cowboy_http:x_www_form_urlencoded/2
|
||||||
|
|
||||||
|
* Various REST bug fixes
|
||||||
|
|
||||||
|
* Do not send chunked replies for HTTP/1.0 connections
|
||||||
|
|
||||||
|
* Fix a DST bug in the cookies code
|
||||||
|
|
||||||
|
* Fix a bug with setting cookie values containing slashes
|
||||||
|
|
||||||
|
* Fix a small timer leak when using loop/websocket timeouts
|
||||||
|
|
||||||
|
* Make charset and media type parsing more relaxed
|
||||||
|
|
||||||
|
This is to accomodate some widely used broken clients.
|
||||||
|
|
||||||
|
* Make error messages more readable
|
||||||
|
|
||||||
|
* Fix and improve type specifications
|
||||||
|
|
||||||
|
* Fix a bug preventing documentation from being generated
|
||||||
|
|
||||||
|
* Small improvements to the documentation
|
||||||
|
|
||||||
|
* Rework the HTTP test suite
|
||||||
|
|
||||||
|
The suite now uses an integrated Cowboy HTTP client. The client
|
||||||
|
is currently experimental and shouldn't be used.
|
||||||
|
|
||||||
|
* Add many many tests.
|
||||||
|
|
||||||
0.4.0
|
0.4.0
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
|
2
LICENSE
2
LICENSE
|
@ -1,4 +1,4 @@
|
||||||
Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
|
Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
Permission to use, copy, modify, and/or distribute this software for any
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
purpose with or without fee is hereby granted, provided that the above
|
||||||
|
|
14
README.md
14
README.md
|
@ -157,28 +157,28 @@ based on the hostname and path information from the request. It also lets
|
||||||
you define static options for the handler directly in the rules.
|
you define static options for the handler directly in the rules.
|
||||||
|
|
||||||
To match the hostname and path, Cowboy requires a list of tokens. For
|
To match the hostname and path, Cowboy requires a list of tokens. For
|
||||||
example, to match the "dev-extend.eu" domain name, you must specify
|
example, to match the "ninenines.eu" domain name, you must specify
|
||||||
`[<<"dev-extend">>, <<"eu">>]`. Or, to match the "/path/to/my/resource"
|
`[<<"ninenines">>, <<"eu">>]`. Or, to match the "/path/to/my/resource"
|
||||||
you must use `[<<"path">>, <<"to">>, <<"my">>, <<"resource">>]`. All the
|
you must use `[<<"path">>, <<"to">>, <<"my">>, <<"resource">>]`. All the
|
||||||
tokens must be given as binary.
|
tokens must be given as binary.
|
||||||
|
|
||||||
You can use the special token `'_'` (the atom underscore) to indicate that
|
You can use the special token `'_'` (the atom underscore) to indicate that
|
||||||
you accept anything in that position. For example if you have both
|
you accept anything in that position. For example if you have both
|
||||||
"dev-extend.eu" and "dev-extend.fr" domains, you can use the match spec
|
"ninenines.eu" and "ninenines.fr" domains, you can use the match spec
|
||||||
`[<<"dev-extend">>, '_']` to match any top level extension.
|
`[<<"ninenines">>, '_']` to match any top level extension.
|
||||||
|
|
||||||
Finally, you can also match multiple leading segments of the domain name and
|
Finally, you can also match multiple leading segments of the domain name and
|
||||||
multiple trailing segments of the request path using the atom `'...'` (the atom
|
multiple trailing segments of the request path using the atom `'...'` (the atom
|
||||||
ellipsis) respectively as the first host token or the last path token. For
|
ellipsis) respectively as the first host token or the last path token. For
|
||||||
example, host rule `['...', <<"dev-extend">>, <<"eu">>]` can match both
|
example, host rule `['...', <<"ninenines">>, <<"eu">>]` can match both
|
||||||
"cowboy.bugs.dev-extend.eu" and "dev-extend.eu" and path rule
|
"cowboy.bugs.ninenines.eu" and "ninenines.eu" and path rule
|
||||||
`[<<"projects">>, '...']` can match both "/projects" and
|
`[<<"projects">>, '...']` can match both "/projects" and
|
||||||
"/projects/cowboy/issues/42". The host leading segments and the path trailing
|
"/projects/cowboy/issues/42". The host leading segments and the path trailing
|
||||||
segments can later be retrieved through `cowboy_http_req:host_info/1` and
|
segments can later be retrieved through `cowboy_http_req:host_info/1` and
|
||||||
`cowboy_http_req:path_info/1`.
|
`cowboy_http_req:path_info/1`.
|
||||||
|
|
||||||
Any other atom used as a token will bind the value to this atom when
|
Any other atom used as a token will bind the value to this atom when
|
||||||
matching. To follow on our hostnames example, `[<<"dev-extend">>, ext]`
|
matching. To follow on our hostnames example, `[<<"ninenines">>, ext]`
|
||||||
would bind the values `<<"eu">>` and `<<"fr">>` to the ext atom, that you
|
would bind the values `<<"eu">>` and `<<"fr">>` to the ext atom, that you
|
||||||
can later retrieve in your handler by calling `cowboy_http_req:binding/{2,3}`.
|
can later retrieve in your handler by calling `cowboy_http_req:binding/{2,3}`.
|
||||||
|
|
||||||
|
|
|
@ -61,14 +61,12 @@ are not ordered.
|
||||||
Tools like curl expect a 100 Continue before sending a
|
Tools like curl expect a 100 Continue before sending a
|
||||||
request body by default.
|
request body by default.
|
||||||
|
|
||||||
* Convert the multipart code to stream_body.
|
|
||||||
|
|
||||||
* Complete the work on Websockets.
|
* Complete the work on Websockets.
|
||||||
|
|
||||||
Now that the Autobahn test suite is available (make inttests),
|
Now that the Autobahn test suite is available (make inttests),
|
||||||
we have a definite way to know whether Cowboy's implementation
|
we have a definite way to know whether Cowboy's implementation
|
||||||
of Websockets is right. The work can thus be completed. The
|
of Websockets is right. The work can thus be completed. The
|
||||||
remaining tasks are proper UTF8 handling.
|
remaining task is proper UTF8 handling.
|
||||||
|
|
||||||
* SPDY support.
|
* SPDY support.
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
@author Loïc Hoguin <essen@dev-extend.eu>
|
@author Loïc Hoguin <essen@ninenines.eu>
|
||||||
@copyright 2011 Loïc Hoguin
|
@copyright 2011-2012 Loïc Hoguin
|
||||||
@version HEAD
|
@version HEAD
|
||||||
@title Small, fast, modular HTTP server.
|
@title Small, fast, modular HTTP server.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
|
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
|
||||||
%% Copyright (c) 2011, Anthony Ramine <nox@dev-extend.eu>
|
%% Copyright (c) 2011, Anthony Ramine <nox@dev-extend.eu>
|
||||||
%%
|
%%
|
||||||
%% Permission to use, copy, modify, and/or distribute this software for any
|
%% Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
|
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
|
||||||
%%
|
%%
|
||||||
%% Permission to use, copy, modify, and/or distribute this software for any
|
%% Permission to use, copy, modify, and/or distribute this software for any
|
||||||
%% purpose with or without fee is hereby granted, provided that the above
|
%% purpose with or without fee is hereby granted, provided that the above
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
{application, cowboy, [
|
{application, cowboy, [
|
||||||
{description, "Small, fast, modular HTTP server."},
|
{description, "Small, fast, modular HTTP server."},
|
||||||
{vsn, "0.5.0"},
|
{vsn, "0.6.0"},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{registered, [cowboy_clock, cowboy_sup]},
|
{registered, [cowboy_clock, cowboy_sup]},
|
||||||
{applications, [
|
{applications, [
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
|
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
|
||||||
%%
|
%%
|
||||||
%% Permission to use, copy, modify, and/or distribute this software for any
|
%% Permission to use, copy, modify, and/or distribute this software for any
|
||||||
%% purpose with or without fee is hereby granted, provided that the above
|
%% purpose with or without fee is hereby granted, provided that the above
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
|
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
|
||||||
%%
|
%%
|
||||||
%% Permission to use, copy, modify, and/or distribute this software for any
|
%% Permission to use, copy, modify, and/or distribute this software for any
|
||||||
%% purpose with or without fee is hereby granted, provided that the above
|
%% purpose with or without fee is hereby granted, provided that the above
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
|
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
|
||||||
%%
|
%%
|
||||||
%% Permission to use, copy, modify, and/or distribute this software for any
|
%% Permission to use, copy, modify, and/or distribute this software for any
|
||||||
%% purpose with or without fee is hereby granted, provided that the above
|
%% purpose with or without fee is hereby granted, provided that the above
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
|
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
|
||||||
%%
|
%%
|
||||||
%% Permission to use, copy, modify, and/or distribute this software for any
|
%% Permission to use, copy, modify, and/or distribute this software for any
|
||||||
%% purpose with or without fee is hereby granted, provided that the above
|
%% purpose with or without fee is hereby granted, provided that the above
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
|
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
|
||||||
%%
|
%%
|
||||||
%% Permission to use, copy, modify, and/or distribute this software for any
|
%% Permission to use, copy, modify, and/or distribute this software for any
|
||||||
%% purpose with or without fee is hereby granted, provided that the above
|
%% purpose with or without fee is hereby granted, provided that the above
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
|
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
|
||||||
%%
|
%%
|
||||||
%% Permission to use, copy, modify, and/or distribute this software for any
|
%% Permission to use, copy, modify, and/or distribute this software for any
|
||||||
%% purpose with or without fee is hereby granted, provided that the above
|
%% purpose with or without fee is hereby granted, provided that the above
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
|
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
|
||||||
%% Copyright (c) 2011, Anthony Ramine <nox@dev-extend.eu>
|
%% Copyright (c) 2011, Anthony Ramine <nox@dev-extend.eu>
|
||||||
%%
|
%%
|
||||||
%% Permission to use, copy, modify, and/or distribute this software for any
|
%% Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
@ -85,8 +85,8 @@ do_split_path(RawPath, Separator, URLDec) ->
|
||||||
%% corresponding token value and return it.
|
%% corresponding token value and return it.
|
||||||
%%
|
%%
|
||||||
%% The list of hostname tokens is reversed before matching. For example, if
|
%% The list of hostname tokens is reversed before matching. For example, if
|
||||||
%% we were to match "www.dev-extend.eu", we would first match "eu", then
|
%% we were to match "www.ninenines.eu", we would first match "eu", then
|
||||||
%% "dev-extend", then "www". This means that in the context of hostnames,
|
%% "ninenines", then "www". This means that in the context of hostnames,
|
||||||
%% the <em>'...'</em> atom matches properly the lower levels of the domain
|
%% the <em>'...'</em> atom matches properly the lower levels of the domain
|
||||||
%% as would be expected.
|
%% as would be expected.
|
||||||
%%
|
%%
|
||||||
|
@ -173,16 +173,16 @@ split_host_test_() ->
|
||||||
{<<"">>, {[], <<"">>, undefined}},
|
{<<"">>, {[], <<"">>, undefined}},
|
||||||
{<<".........">>, {[], <<".........">>, undefined}},
|
{<<".........">>, {[], <<".........">>, undefined}},
|
||||||
{<<"*">>, {[<<"*">>], <<"*">>, undefined}},
|
{<<"*">>, {[<<"*">>], <<"*">>, undefined}},
|
||||||
{<<"cowboy.dev-extend.eu">>,
|
{<<"cowboy.ninenines.eu">>,
|
||||||
{[<<"cowboy">>, <<"dev-extend">>, <<"eu">>],
|
{[<<"cowboy">>, <<"ninenines">>, <<"eu">>],
|
||||||
<<"cowboy.dev-extend.eu">>, undefined}},
|
<<"cowboy.ninenines.eu">>, undefined}},
|
||||||
{<<"dev-extend..eu">>,
|
{<<"ninenines..eu">>,
|
||||||
{[<<"dev-extend">>, <<>>, <<"eu">>],
|
{[<<"ninenines">>, <<>>, <<"eu">>],
|
||||||
<<"dev-extend..eu">>, undefined}},
|
<<"ninenines..eu">>, undefined}},
|
||||||
{<<"dev-extend.eu">>,
|
{<<"ninenines.eu">>,
|
||||||
{[<<"dev-extend">>, <<"eu">>], <<"dev-extend.eu">>, undefined}},
|
{[<<"ninenines">>, <<"eu">>], <<"ninenines.eu">>, undefined}},
|
||||||
{<<"dev-extend.eu:8080">>,
|
{<<"ninenines.eu:8080">>,
|
||||||
{[<<"dev-extend">>, <<"eu">>], <<"dev-extend.eu">>, 8080}},
|
{[<<"ninenines">>, <<"eu">>], <<"ninenines.eu">>, 8080}},
|
||||||
{<<"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">>,
|
{<<"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">>,
|
||||||
{[<<"a">>, <<"b">>, <<"c">>, <<"d">>, <<"e">>, <<"f">>, <<"g">>,
|
{[<<"a">>, <<"b">>, <<"c">>, <<"d">>, <<"e">>, <<"f">>, <<"g">>,
|
||||||
<<"h">>, <<"i">>, <<"j">>, <<"k">>, <<"l">>, <<"m">>, <<"n">>,
|
<<"h">>, <<"i">>, <<"j">>, <<"k">>, <<"l">>, <<"m">>, <<"n">>,
|
||||||
|
@ -195,13 +195,13 @@ split_host_test_() ->
|
||||||
|
|
||||||
split_host_fail_test_() ->
|
split_host_fail_test_() ->
|
||||||
Tests = [
|
Tests = [
|
||||||
<<"dev-extend.eu:owns">>,
|
<<"ninenines.eu:owns">>,
|
||||||
<<"dev-extend.eu: owns">>,
|
<<"ninenines.eu: owns">>,
|
||||||
<<"dev-extend.eu:42fun">>,
|
<<"ninenines.eu:42fun">>,
|
||||||
<<"dev-extend.eu: 42fun">>,
|
<<"ninenines.eu: 42fun">>,
|
||||||
<<"dev-extend.eu:42 fun">>,
|
<<"ninenines.eu:42 fun">>,
|
||||||
<<"dev-extend.eu:fun 42">>,
|
<<"ninenines.eu:fun 42">>,
|
||||||
<<"dev-extend.eu: 42">>,
|
<<"ninenines.eu: 42">>,
|
||||||
<<":owns">>,
|
<<":owns">>,
|
||||||
<<":42 fun">>
|
<<":42 fun">>
|
||||||
],
|
],
|
||||||
|
@ -233,14 +233,14 @@ split_path_test_() ->
|
||||||
|
|
||||||
match_test_() ->
|
match_test_() ->
|
||||||
Dispatch = [
|
Dispatch = [
|
||||||
{[<<"www">>, '_', <<"dev-extend">>, <<"eu">>], [
|
{[<<"www">>, '_', <<"ninenines">>, <<"eu">>], [
|
||||||
{[<<"users">>, '_', <<"mails">>], match_any_subdomain_users, []}
|
{[<<"users">>, '_', <<"mails">>], match_any_subdomain_users, []}
|
||||||
]},
|
]},
|
||||||
{[<<"dev-extend">>, <<"eu">>], [
|
{[<<"ninenines">>, <<"eu">>], [
|
||||||
{[<<"users">>, id, <<"friends">>], match_extend_users_friends, []},
|
{[<<"users">>, id, <<"friends">>], match_extend_users_friends, []},
|
||||||
{'_', match_extend, []}
|
{'_', match_extend, []}
|
||||||
]},
|
]},
|
||||||
{[<<"dev-extend">>, var], [
|
{[<<"ninenines">>, var], [
|
||||||
{[<<"threads">>, var], match_duplicate_vars,
|
{[<<"threads">>, var], match_duplicate_vars,
|
||||||
[we, {expect, two}, var, here]}
|
[we, {expect, two}, var, here]}
|
||||||
]},
|
]},
|
||||||
|
@ -255,22 +255,22 @@ match_test_() ->
|
||||||
%% {Host, Path, Result}
|
%% {Host, Path, Result}
|
||||||
Tests = [
|
Tests = [
|
||||||
{[<<"any">>], [], {ok, match_any, [], []}},
|
{[<<"any">>], [], {ok, match_any, [], []}},
|
||||||
{[<<"www">>, <<"any">>, <<"dev-extend">>, <<"eu">>],
|
{[<<"www">>, <<"any">>, <<"ninenines">>, <<"eu">>],
|
||||||
[<<"users">>, <<"42">>, <<"mails">>],
|
[<<"users">>, <<"42">>, <<"mails">>],
|
||||||
{ok, match_any_subdomain_users, [], []}},
|
{ok, match_any_subdomain_users, [], []}},
|
||||||
{[<<"www">>, <<"dev-extend">>, <<"eu">>],
|
{[<<"www">>, <<"ninenines">>, <<"eu">>],
|
||||||
[<<"users">>, <<"42">>, <<"mails">>], {ok, match_any, [], []}},
|
[<<"users">>, <<"42">>, <<"mails">>], {ok, match_any, [], []}},
|
||||||
{[<<"www">>, <<"dev-extend">>, <<"eu">>], [], {ok, match_any, [], []}},
|
{[<<"www">>, <<"ninenines">>, <<"eu">>], [], {ok, match_any, [], []}},
|
||||||
{[<<"www">>, <<"any">>, <<"dev-extend">>, <<"eu">>],
|
{[<<"www">>, <<"any">>, <<"ninenines">>, <<"eu">>],
|
||||||
[<<"not_users">>, <<"42">>, <<"mails">>], {error, notfound, path}},
|
[<<"not_users">>, <<"42">>, <<"mails">>], {error, notfound, path}},
|
||||||
{[<<"dev-extend">>, <<"eu">>], [], {ok, match_extend, [], []}},
|
{[<<"ninenines">>, <<"eu">>], [], {ok, match_extend, [], []}},
|
||||||
{[<<"dev-extend">>, <<"eu">>], [<<"users">>, <<"42">>, <<"friends">>],
|
{[<<"ninenines">>, <<"eu">>], [<<"users">>, <<"42">>, <<"friends">>],
|
||||||
{ok, match_extend_users_friends, [], [{id, <<"42">>}]}},
|
{ok, match_extend_users_friends, [], [{id, <<"42">>}]}},
|
||||||
{[<<"erlang">>, <<"fr">>], '_',
|
{[<<"erlang">>, <<"fr">>], '_',
|
||||||
{ok, match_erlang_ext, [], [{ext, <<"fr">>}]}},
|
{ok, match_erlang_ext, [], [{ext, <<"fr">>}]}},
|
||||||
{[<<"any">>], [<<"users">>, <<"444">>, <<"friends">>],
|
{[<<"any">>], [<<"users">>, <<"444">>, <<"friends">>],
|
||||||
{ok, match_users_friends, [], [{id, <<"444">>}]}},
|
{ok, match_users_friends, [], [{id, <<"444">>}]}},
|
||||||
{[<<"dev-extend">>, <<"fr">>], [<<"threads">>, <<"987">>],
|
{[<<"ninenines">>, <<"fr">>], [<<"threads">>, <<"987">>],
|
||||||
{ok, match_duplicate_vars, [we, {expect, two}, var, here],
|
{ok, match_duplicate_vars, [we, {expect, two}, var, here],
|
||||||
[{var, <<"fr">>}, {var, <<"987">>}]}}
|
[{var, <<"fr">>}, {var, <<"987">>}]}}
|
||||||
],
|
],
|
||||||
|
@ -280,27 +280,27 @@ match_test_() ->
|
||||||
|
|
||||||
match_info_test_() ->
|
match_info_test_() ->
|
||||||
Dispatch = [
|
Dispatch = [
|
||||||
{[<<"www">>, <<"dev-extend">>, <<"eu">>], [
|
{[<<"www">>, <<"ninenines">>, <<"eu">>], [
|
||||||
{[<<"pathinfo">>, <<"is">>, <<"next">>, '...'], match_path, []}
|
{[<<"pathinfo">>, <<"is">>, <<"next">>, '...'], match_path, []}
|
||||||
]},
|
]},
|
||||||
{['...', <<"dev-extend">>, <<"eu">>], [
|
{['...', <<"ninenines">>, <<"eu">>], [
|
||||||
{'_', match_any, []}
|
{'_', match_any, []}
|
||||||
]}
|
]}
|
||||||
],
|
],
|
||||||
Tests = [
|
Tests = [
|
||||||
{[<<"dev-extend">>, <<"eu">>], [],
|
{[<<"ninenines">>, <<"eu">>], [],
|
||||||
{ok, match_any, [], [], [], undefined}},
|
{ok, match_any, [], [], [], undefined}},
|
||||||
{[<<"bugs">>, <<"dev-extend">>, <<"eu">>], [],
|
{[<<"bugs">>, <<"ninenines">>, <<"eu">>], [],
|
||||||
{ok, match_any, [], [], [<<"bugs">>], undefined}},
|
{ok, match_any, [], [], [<<"bugs">>], undefined}},
|
||||||
{[<<"cowboy">>, <<"bugs">>, <<"dev-extend">>, <<"eu">>], [],
|
{[<<"cowboy">>, <<"bugs">>, <<"ninenines">>, <<"eu">>], [],
|
||||||
{ok, match_any, [], [], [<<"cowboy">>, <<"bugs">>], undefined}},
|
{ok, match_any, [], [], [<<"cowboy">>, <<"bugs">>], undefined}},
|
||||||
{[<<"www">>, <<"dev-extend">>, <<"eu">>],
|
{[<<"www">>, <<"ninenines">>, <<"eu">>],
|
||||||
[<<"pathinfo">>, <<"is">>, <<"next">>],
|
[<<"pathinfo">>, <<"is">>, <<"next">>],
|
||||||
{ok, match_path, [], [], undefined, []}},
|
{ok, match_path, [], [], undefined, []}},
|
||||||
{[<<"www">>, <<"dev-extend">>, <<"eu">>],
|
{[<<"www">>, <<"ninenines">>, <<"eu">>],
|
||||||
[<<"pathinfo">>, <<"is">>, <<"next">>, <<"path_info">>],
|
[<<"pathinfo">>, <<"is">>, <<"next">>, <<"path_info">>],
|
||||||
{ok, match_path, [], [], undefined, [<<"path_info">>]}},
|
{ok, match_path, [], [], undefined, [<<"path_info">>]}},
|
||||||
{[<<"www">>, <<"dev-extend">>, <<"eu">>],
|
{[<<"www">>, <<"ninenines">>, <<"eu">>],
|
||||||
[<<"pathinfo">>, <<"is">>, <<"next">>, <<"foo">>, <<"bar">>],
|
[<<"pathinfo">>, <<"is">>, <<"next">>, <<"foo">>, <<"bar">>],
|
||||||
{ok, match_path, [], [], undefined, [<<"foo">>, <<"bar">>]}}
|
{ok, match_path, [], [], undefined, [<<"foo">>, <<"bar">>]}}
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
|
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
|
||||||
%% Copyright (c) 2011, Anthony Ramine <nox@dev-extend.eu>
|
%% Copyright (c) 2011, Anthony Ramine <nox@dev-extend.eu>
|
||||||
%%
|
%%
|
||||||
%% Permission to use, copy, modify, and/or distribute this software for any
|
%% Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
|
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
|
||||||
%%
|
%%
|
||||||
%% Permission to use, copy, modify, and/or distribute this software for any
|
%% Permission to use, copy, modify, and/or distribute this software for any
|
||||||
%% purpose with or without fee is hereby granted, provided that the above
|
%% purpose with or without fee is hereby granted, provided that the above
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
|
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
|
||||||
%% Copyright (c) 2011, Anthony Ramine <nox@dev-extend.eu>
|
%% Copyright (c) 2011, Anthony Ramine <nox@dev-extend.eu>
|
||||||
%%
|
%%
|
||||||
%% Permission to use, copy, modify, and/or distribute this software for any
|
%% Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
|
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
|
||||||
%% Copyright (c) 2011, Anthony Ramine <nox@dev-extend.eu>
|
%% Copyright (c) 2011, Anthony Ramine <nox@dev-extend.eu>
|
||||||
%%
|
%%
|
||||||
%% Permission to use, copy, modify, and/or distribute this software for any
|
%% Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
|
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
|
||||||
%%
|
%%
|
||||||
%% Permission to use, copy, modify, and/or distribute this software for any
|
%% Permission to use, copy, modify, and/or distribute this software for any
|
||||||
%% purpose with or without fee is hereby granted, provided that the above
|
%% purpose with or without fee is hereby granted, provided that the above
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
|
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
|
||||||
%%
|
%%
|
||||||
%% Permission to use, copy, modify, and/or distribute this software for any
|
%% Permission to use, copy, modify, and/or distribute this software for any
|
||||||
%% purpose with or without fee is hereby granted, provided that the above
|
%% purpose with or without fee is hereby granted, provided that the above
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
|
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
|
||||||
%%
|
%%
|
||||||
%% Permission to use, copy, modify, and/or distribute this software for any
|
%% Permission to use, copy, modify, and/or distribute this software for any
|
||||||
%% purpose with or without fee is hereby granted, provided that the above
|
%% purpose with or without fee is hereby granted, provided that the above
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
|
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
|
||||||
%%
|
%%
|
||||||
%% Permission to use, copy, modify, and/or distribute this software for any
|
%% Permission to use, copy, modify, and/or distribute this software for any
|
||||||
%% purpose with or without fee is hereby granted, provided that the above
|
%% purpose with or without fee is hereby granted, provided that the above
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
|
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
|
||||||
%%
|
%%
|
||||||
%% Permission to use, copy, modify, and/or distribute this software for any
|
%% Permission to use, copy, modify, and/or distribute this software for any
|
||||||
%% purpose with or without fee is hereby granted, provided that the above
|
%% purpose with or without fee is hereby granted, provided that the above
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
|
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
|
||||||
%% Copyright (c) 2011, Michiel Hakvoort <michiel@hakvoort.it>
|
%% Copyright (c) 2011, Michiel Hakvoort <michiel@hakvoort.it>
|
||||||
%%
|
%%
|
||||||
%% Permission to use, copy, modify, and/or distribute this software for any
|
%% Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
|
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
|
||||||
%%
|
%%
|
||||||
%% Permission to use, copy, modify, and/or distribute this software for any
|
%% Permission to use, copy, modify, and/or distribute this software for any
|
||||||
%% purpose with or without fee is hereby granted, provided that the above
|
%% purpose with or without fee is hereby granted, provided that the above
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
|
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
|
||||||
%%
|
%%
|
||||||
%% Permission to use, copy, modify, and/or distribute this software for any
|
%% Permission to use, copy, modify, and/or distribute this software for any
|
||||||
%% purpose with or without fee is hereby granted, provided that the above
|
%% purpose with or without fee is hereby granted, provided that the above
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
|
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
|
||||||
%%
|
%%
|
||||||
%% Permission to use, copy, modify, and/or distribute this software for any
|
%% Permission to use, copy, modify, and/or distribute this software for any
|
||||||
%% purpose with or without fee is hereby granted, provided that the above
|
%% purpose with or without fee is hereby granted, provided that the above
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
|
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
|
||||||
%%
|
%%
|
||||||
%% Permission to use, copy, modify, and/or distribute this software for any
|
%% Permission to use, copy, modify, and/or distribute this software for any
|
||||||
%% purpose with or without fee is hereby granted, provided that the above
|
%% purpose with or without fee is hereby granted, provided that the above
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
%% Copyright (c) 2011, Magnus Klaar <magnus.klaar@gmail.com>
|
%% Copyright (c) 2011, Magnus Klaar <magnus.klaar@gmail.com>
|
||||||
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
|
%% Copyright (c) 2011, Loïc Hoguin <essen@ninenines.eu>
|
||||||
%%
|
%%
|
||||||
%% Permission to use, copy, modify, and/or distribute this software for any
|
%% Permission to use, copy, modify, and/or distribute this software for any
|
||||||
%% purpose with or without fee is hereby granted, provided that the above
|
%% purpose with or without fee is hereby granted, provided that the above
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
|
%% Copyright (c) 2011-2012, Loïc Hoguin <essen@ninenines.eu>
|
||||||
%% Copyright (c) 2011, Anthony Ramine <nox@dev-extend.eu>
|
%% Copyright (c) 2011, Anthony Ramine <nox@dev-extend.eu>
|
||||||
%%
|
%%
|
||||||
%% Permission to use, copy, modify, and/or distribute this software for any
|
%% Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
@ -358,7 +358,7 @@ The document has moved
|
||||||
{400, "\n"},
|
{400, "\n"},
|
||||||
{400, "Garbage\r\n\r\n"},
|
{400, "Garbage\r\n\r\n"},
|
||||||
{400, "\r\n\r\n\r\n\r\n\r\n\r\n"},
|
{400, "\r\n\r\n\r\n\r\n\r\n\r\n"},
|
||||||
{400, "GET / HTTP/1.1\r\nHost: dev-extend.eu\r\n\r\n"},
|
{400, "GET / HTTP/1.1\r\nHost: ninenines.eu\r\n\r\n"},
|
||||||
{400, "GET http://proxy/ HTTP/1.1\r\n\r\n"},
|
{400, "GET http://proxy/ HTTP/1.1\r\n\r\n"},
|
||||||
{400, ResponsePacket},
|
{400, ResponsePacket},
|
||||||
{408, "GET / HTTP/1.1\r\n"},
|
{408, "GET / HTTP/1.1\r\n"},
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
|
%% Copyright (c) 2011, Loïc Hoguin <essen@ninenines.eu>
|
||||||
%%
|
%%
|
||||||
%% Permission to use, copy, modify, and/or distribute this software for any
|
%% Permission to use, copy, modify, and/or distribute this software for any
|
||||||
%% purpose with or without fee is hereby granted, provided that the above
|
%% purpose with or without fee is hereby granted, provided that the above
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%% Copyright (c) 2011, Loïc Hoguin <essen@dev-extend.eu>
|
%% Copyright (c) 2011, Loïc Hoguin <essen@ninenines.eu>
|
||||||
%%
|
%%
|
||||||
%% Permission to use, copy, modify, and/or distribute this software for any
|
%% Permission to use, copy, modify, and/or distribute this software for any
|
||||||
%% purpose with or without fee is hereby granted, provided that the above
|
%% purpose with or without fee is hereby granted, provided that the above
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue