Skip to content

Commit db16095

Browse files
committed
Change headers to be lower case in example application
Headers must be lowercase.
1 parent 92e396d commit db16095

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

examples/simpleapp/lib/simpleapp.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule Simpleapp do
22
use Plug.Router
33

4-
plug Mellon, validator: {Simpleapp, :authenticate, []}, header: "X-AUTH"
4+
plug Mellon, validator: {Simpleapp, :authenticate, []}, header: "x-auth"
55

66
plug :match
77
plug :dispatch

examples/simpleapp/test/simpleapp_test.exs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ defmodule SimpleappTest do
1313

1414
test "denied if invalid token" do
1515
conn = conn(:get, "/hello")
16-
|> put_req_header("X-AUTH", "Token: InvalidToken")
16+
|> put_req_header("x-auth", "Token: InvalidToken")
1717
|> Simpleapp.call([])
1818

1919
assert conn.state == :sent
@@ -23,7 +23,7 @@ defmodule SimpleappTest do
2323

2424
test "denied if token form is wrong" do
2525
conn = conn(:get, "/hello")
26-
|> put_req_header("X-AUTH", "")
26+
|> put_req_header("x-auth", "")
2727
|> Simpleapp.call([])
2828

2929
assert conn.state == :sent
@@ -33,7 +33,7 @@ defmodule SimpleappTest do
3333

3434
test "/hello ok if correct credentials" do
3535
conn = conn(:get, "/hello")
36-
|> put_req_header("X-AUTH", "Token: ValidToken")
36+
|> put_req_header("x-auth", "Token: ValidToken")
3737
|> Simpleapp.call([])
3838

3939
assert conn.state == :sent

0 commit comments

Comments
 (0)