mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 20:30:23 +00:00
Add a cowboy_rest test for malformed if-*-match headers
This commit is contained in:
parent
09bf1199aa
commit
b3bfcf068c
2 changed files with 37 additions and 0 deletions
16
test/handlers/rest_hello_h.erl
Normal file
16
test/handlers/rest_hello_h.erl
Normal file
|
@ -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}.
|
Loading…
Add table
Add a link
Reference in a new issue