mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Improve basic_auth example
Some web browsers will now prompt for user name and password
This commit is contained in:
parent
ae401f7460
commit
fbdd3af63e
1 changed files with 1 additions and 1 deletions
|
@ -18,7 +18,7 @@ is_authorized(Req, S) ->
|
||||||
{<<"basic">>, {User = <<"Alladin">>, <<"open sesame">>}} ->
|
{<<"basic">>, {User = <<"Alladin">>, <<"open sesame">>}} ->
|
||||||
{true, Req1, User};
|
{true, Req1, User};
|
||||||
_ ->
|
_ ->
|
||||||
{{false, <<"Restricted">>}, Req1, S}
|
{{false, <<"Basic realm=\"cowboy\"">>}, Req1, S}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
content_types_provided(Req, State) ->
|
content_types_provided(Req, State) ->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue