aboutsummaryrefslogtreecommitdiffstats
path: root/examples/rest_basic_auth/src/toppage_handler.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2016-01-14 20:00:50 +0100
committerLoïc Hoguin <[email protected]>2016-01-14 20:00:50 +0100
commit394b4f0bf7f2a4d496ffe69c8e30cff153d69532 (patch)
tree82c3d7634f93596ec42b41050b4130805a359359 /examples/rest_basic_auth/src/toppage_handler.erl
parent4023e7f4e429179fd9c2cce4487c33646c6bd327 (diff)
downloadcowboy-394b4f0bf7f2a4d496ffe69c8e30cff153d69532.tar.gz
cowboy-394b4f0bf7f2a4d496ffe69c8e30cff153d69532.tar.bz2
cowboy-394b4f0bf7f2a4d496ffe69c8e30cff153d69532.zip
Simplify example instructions and fix broken examples
Also convert to AsciiDoc while we're at it.
Diffstat (limited to 'examples/rest_basic_auth/src/toppage_handler.erl')
-rw-r--r--examples/rest_basic_auth/src/toppage_handler.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/rest_basic_auth/src/toppage_handler.erl b/examples/rest_basic_auth/src/toppage_handler.erl
index 18a8cae..2e8250f 100644
--- a/examples/rest_basic_auth/src/toppage_handler.erl
+++ b/examples/rest_basic_auth/src/toppage_handler.erl
@@ -13,7 +13,7 @@ init(Req, Opts) ->
is_authorized(Req, State) ->
case cowboy_req:parse_header(<<"authorization">>, Req) of
- {<<"basic">>, {User = <<"Alladin">>, <<"open sesame">>}} ->
+ {basic, User = <<"Alladin">>, <<"open sesame">>} ->
{true, Req, User};
_ ->
{{false, <<"Basic realm=\"cowboy\"">>}, Req, State}