0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 20:30:23 +00:00
cowboy/test
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
..
autobahn_SUITE_data Update autobahn suite to use autobahntestsuite 2012-04-06 17:53:53 +02:00
http_SUITE_data Initial work on a ct test suite for the HTTP protocol. 2011-04-08 16:30:37 +02:00
autobahn_SUITE.erl Add Autobahn test suite for websockets 2012-01-25 12:10:05 +01:00
chunked_handler.erl Add shortcuts to reply functions 2011-10-13 16:16:53 +02:00
dispatcher_prop.erl Add a PropEr test for cowboy_dispatcher:split_host/1 2011-07-26 10:46:06 +02:00
http_handler.erl Fix a bug where dupe headers were sent in cowboy_http_req:reply/4. 2011-04-14 01:32:02 +02:00
http_handler_echo_body.erl Add chunked transfer encoding support and rework the body reading API 2012-04-01 21:25:55 +02:00
http_handler_errors.erl Add tests for #114 2011-12-29 00:06:22 +01:00
http_handler_init_shutdown.erl Fix the init_shutdown test 2011-10-19 18:50:06 +02:00
http_handler_long_polling.erl Fix and rework the HTTP test suite 2012-04-29 15:22:20 +02:00
http_handler_multipart.erl Merge branch 'multipart' of https://github.com/nox/cowboy 2012-01-23 07:37:49 +01:00
http_handler_set_resp.erl Add cowboy_http_req:set_resp_cookie/4 2011-12-07 11:54:57 +01:00
http_handler_stream_body.erl Add cowboy_http_req:set_resp_body_fun/3. 2011-12-28 18:17:10 +01:00
http_SUITE.erl Add an 'onresponse' hook 2012-05-04 06:24:10 +02:00
proper_SUITE.erl Add a PropEr test for cowboy_dispatcher:split_host/1 2011-07-26 10:46:06 +02:00
rest_forbidden_resource.erl Merge branch 'master' of https://github.com/bfrog/cowboy 2012-01-23 21:57:20 +01:00
rest_nodelete_resource.erl Handle delete better when no delete_resource function is implemented 2012-01-26 18:21:20 +01:00
rest_resource_etags.erl Tests and fixes for the generate_etag/2 callback 2012-02-29 22:32:37 +01:00
rest_simple_resource.erl Add experimental Webmachine based REST protocol support 2011-12-05 23:05:32 +01:00
websocket_echo_handler.erl Add Autobahn test suite for websockets 2012-01-25 12:10:05 +01:00
websocket_handler.erl Add ct tests for binary websocket frames 2011-12-22 20:19:05 +01:00
websocket_handler_init_shutdown.erl Fix a websocket test handler that was throwing an unwanted error 2011-11-28 09:14:07 +01:00
ws_SUITE.erl Add support for fragmented websocket messages 2012-04-05 22:02:04 +02:00
ws_timeout_hibernate_handler.erl Add a test for websocket hibernate + timeout and fix this use case 2011-09-22 23:15:54 +02:00