diff options
author | Loïc Hoguin <[email protected]> | 2018-10-31 22:41:59 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2018-10-31 22:41:59 +0100 |
commit | b3bfcf068c20573ae06df42530f1a6d4dc6842c7 (patch) | |
tree | ecd450c038789864a6c725b0ff365a650f683ea3 /test/handlers/rest_hello_h.erl | |
parent | 09bf1199aa3e33a73970ee4ce38714be087b0df0 (diff) | |
download | cowboy-b3bfcf068c20573ae06df42530f1a6d4dc6842c7.tar.gz cowboy-b3bfcf068c20573ae06df42530f1a6d4dc6842c7.tar.bz2 cowboy-b3bfcf068c20573ae06df42530f1a6d4dc6842c7.zip |
Add a cowboy_rest test for malformed if-*-match headers
Diffstat (limited to 'test/handlers/rest_hello_h.erl')
-rw-r--r-- | test/handlers/rest_hello_h.erl | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/handlers/rest_hello_h.erl b/test/handlers/rest_hello_h.erl new file mode 100644 index 0000000..a40d6ac --- /dev/null +++ b/test/handlers/rest_hello_h.erl @@ -0,0 +1,16 @@ +%% This module sends a hello world response via a REST handler. + +-module(rest_hello_h). + +-export([init/2]). +-export([content_types_provided/2]). +-export([get_text_plain/2]). + +init(Req, Opts) -> + {cowboy_rest, Req, Opts}. + +content_types_provided(Req, State) -> + {[{{<<"text">>, <<"plain">>, []}, get_text_plain}], Req, State}. + +get_text_plain(Req, State) -> + {<<"This is REST!">>, Req, State}. |