0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-15 04:30:25 +00:00

Implement authorization header parsing

Basic HTTP authorization according to RFC 2617 is implemented.
Added an example of its usage with REST handler.
This commit is contained in:
Ivan Lisenkov 2013-01-30 00:30:05 +04:00
parent fd5a977a39
commit 54c6d3fa3a
11 changed files with 228 additions and 0 deletions

View file

@ -0,0 +1,25 @@
%% Feel free to use, reuse and abuse the code in this file.
%% @private
-module(basic_auth_app).
-behaviour(application).
%% API.
-export([start/2]).
-export([stop/1]).
%% API.
start(_Type, _Args) ->
Dispatch = [
{'_', [
{[], toppage_handler, []}
]}
],
{ok, _} = cowboy:start_http(http, 100, [{port, 8080}], [
{env, [{dispatch, Dispatch}]}
]),
basic_auth_sup:start_link().
stop(_State) ->
ok.