0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00
cowboy/test/handlers/custom_req_fields_h.erl

11 lines
291 B
Erlang
Raw Permalink Normal View History

2019-09-06 12:25:02 +02:00
%% This module adds custom fields to the Req object.
%% It is only meant to be checked by Dialyzer.
-module(custom_req_fields_h).
-export([init/2]).
-spec init(Req, Opts) -> {ok, Req, Opts} when Req::cowboy_req:req().
init(Req, Opts) ->
{ok, Req#{'_myapp_auth_method' => pubkey}, Opts}.