0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-15 12:40:25 +00:00
cowboy/src
Loïc Hoguin 57fda14217 Add an 'onresponse' hook
This new protocol option is a fun.

It expects 3 args: the Status code used in the reply (this is the
cowboy_http:status() type, it can be an integer or a binary), the
headers that will be sent in the reply, and the Req. It should
only return a possibly modified Req. This can be used for many
things like error logging or custom error pages.

If a reply is sent inside the hook, then Cowboy will discard the
reply initially sent. Extra caution must be used in the handlers
making use of inline chunked replies as they will throw an error.

This fun cannot be used as a filter, you can either observe the
reply sent or discard it to send a different one instead.

The hook will not be called for replies sent from inside the hook.
2012-05-04 06:24:10 +02:00
..
cowboy.app.src Welcome to new developments with 0.5.0 2012-01-12 20:08:35 +01:00
cowboy.erl Add cowboy:get_protocol_options/1 and cowboy_set_protocol_options/2 2012-01-31 08:49:15 +01:00
cowboy_acceptor.erl Check for upgrades on accept timeout 2012-02-20 09:31:22 +01:00
cowboy_acceptors_sup.erl polished dialyzer warnings on supervisor init/1 specs 2012-02-20 21:25:19 -08:00
cowboy_app.erl Fix a dialyzer warning 2011-12-15 20:45:12 +01:00
cowboy_bstr.erl Move a few binary string handling functions to cowboy_bstr 2011-10-04 18:34:14 +02:00
cowboy_client.erl Add an 'onresponse' hook 2012-05-04 06:24:10 +02:00
cowboy_clock.erl Fix issue #157 relating to daylight savings time. 2012-03-09 20:42:12 +01:00
cowboy_cookies.erl Use calendar date and time types exported since R14B04 2011-12-26 10:17:29 +01:00
cowboy_dispatcher.erl Rename inet:ip_port() to inet:port_number() 2012-03-12 21:57:07 +01:00
cowboy_http.erl Fix and rework the HTTP test suite 2012-04-29 15:22:20 +02:00
cowboy_http_handler.erl Add documentation for the public interface. 2011-07-06 17:42:20 +02:00
cowboy_http_protocol.erl Add an 'onresponse' hook 2012-05-04 06:24:10 +02:00
cowboy_http_req.erl Add an 'onresponse' hook 2012-05-04 06:24:10 +02:00
cowboy_http_rest.erl Convert request to proplist when logging 2012-04-01 17:57:00 +02:00
cowboy_http_static.erl Merge branch 'patch-1' of https://github.com/si14/cowboy 2012-03-23 01:55:30 +01:00
cowboy_http_websocket.erl Merge branch 'websocket-fragments' of https://github.com/klaar/cowboy 2012-04-06 22:18:09 +02:00
cowboy_http_websocket_handler.erl Allow websocket handlers to hibernate from the websocket_init/3 function 2011-09-15 23:20:02 +02:00
cowboy_listener.erl Check for upgrades on accept timeout 2012-02-20 09:31:22 +01:00
cowboy_listener_sup.erl Add cowboy:get_protocol_options/1 and cowboy_set_protocol_options/2 2012-01-31 08:49:15 +01:00
cowboy_multipart.erl Add 'Expect' header parsing 2012-02-20 08:25:05 +01:00
cowboy_protocol.erl Add cowboy:accept_ack/1 for a cleaner handling of the shoot message 2011-12-15 20:19:02 +01:00
cowboy_requests_sup.erl polished dialyzer warnings on supervisor init/1 specs 2012-02-20 21:25:19 -08:00
cowboy_ssl_transport.erl Fix and rework the HTTP test suite 2012-04-29 15:22:20 +02:00
cowboy_sup.erl polished dialyzer warnings on supervisor init/1 specs 2012-02-20 21:25:19 -08:00
cowboy_tcp_transport.erl Fix and rework the HTTP test suite 2012-04-29 15:22:20 +02:00