Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 30 lines (23 sloc) 0.73 kb
c639d63 @rustyio Change interfaces.
rustyio authored
1 % Simple Bridge
2474bae @rustyio Update copyright to 2010.
rustyio authored
2 % Copyright (c) 2008-2010 Rusty Klophaus
c639d63 @rustyio Change interfaces.
rustyio authored
3 % See MIT-LICENSE for licensing information.
4
5 -module (simple_bridge_response).
b6389e6 @rustyio Clean up include names, add "Expires" header to Yaws and Mochiweb.
rustyio authored
6 -include_lib ("simple_bridge.hrl").
c639d63 @rustyio Change interfaces.
rustyio authored
7 -export ([
b6389e6 @rustyio Clean up include names, add "Expires" header to Yaws and Mochiweb.
rustyio authored
8 make/2,
9 behaviour_info/1
c639d63 @rustyio Change interfaces.
rustyio authored
10 ]).
11
0904aab @rustyio Wrap bridge creation methods and log exceptions. Filter out headers w…
rustyio authored
12
13 make(Module, ResponseData) ->
b6389e6 @rustyio Clean up include names, add "Expires" header to Yaws and Mochiweb.
rustyio authored
14 try
15 make_nocatch(Module, ResponseData)
16 catch Type : Error ->
17 error_logger:error_msg("Error in simple_bridge_response:make/2 - ~p - ~p~n~p", [Type, Error, erlang:get_stacktrace()]),
18 erlang:Type(Error)
19 end.
0904aab @rustyio Wrap bridge creation methods and log exceptions. Filter out headers w…
rustyio authored
20
21 make_nocatch(Mod, ResponseData) ->
121ace4 @choptastic Add Cowboy Support (Thanks to @tuncer and @essen)
choptastic authored
22 ResponseData1 = Mod:init(ResponseData),
23 simple_bridge_response_wrapper:new(Mod, ResponseData1, #response{}).
c639d63 @rustyio Change interfaces.
rustyio authored
24
25 behaviour_info(callbacks) -> [
b6389e6 @rustyio Clean up include names, add "Expires" header to Yaws and Mochiweb.
rustyio authored
26 {build_response, 2}
c639d63 @rustyio Change interfaces.
rustyio authored
27 ];
28
2474bae @rustyio Update copyright to 2010.
rustyio authored
29 behaviour_info(_) -> ok.
Something went wrong with that request. Please try again.