Skip to content

Commit

Permalink
Merge pull request #97 from lucafavatella/header-case
Browse files Browse the repository at this point in the history
Ease usage of returned headers
  • Loading branch information
Brujo Benavides authored Jun 12, 2017
2 parents 7e1a494 + 88d8777 commit 8a932b6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/sr_request.erl
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@

-type binding_name() :: id | atom().

-type http_header_name_lowercase() :: binary().
-type http_header() :: {http_header_name_lowercase(), iodata()}.

-opaque req() ::
#{ body := sr_json:json()
, headers := [{binary(), iodata()}]
, headers := [http_header()]
, path := binary()
, bindings := #{binding_name() => any()}
}.
Expand Down Expand Up @@ -44,7 +47,7 @@ from_cowboy(CowboyReq) ->
body(#{body := Body}) ->
Body.

-spec headers(req()) -> [{binary(), iodata()}].
-spec headers(req()) -> [http_header()].
headers(#{headers := Headers}) ->
Headers.

Expand Down

0 comments on commit 8a932b6

Please sign in to comment.