diff options
author | Loïc Hoguin <[email protected]> | 2014-06-10 08:38:54 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2014-06-10 08:39:40 +0200 |
commit | fc7e038fbab8ad1b5b11548f9d009c1b6ccd4be3 (patch) | |
tree | 4fc8ce506d07f8acf08ed545aaf0df18dbcd9d06 /src | |
parent | 7a808e0aa3e764d923da74e18f76790936d19a35 (diff) | |
parent | 6ed25fd60b0cc502ae79baf20456bb2d2b02973e (diff) | |
download | cowboy-fc7e038fbab8ad1b5b11548f9d009c1b6ccd4be3.tar.gz cowboy-fc7e038fbab8ad1b5b11548f9d009c1b6ccd4be3.tar.bz2 cowboy-fc7e038fbab8ad1b5b11548f9d009c1b6ccd4be3.zip |
Merge branch 'binary-expires' of git://github.com/NineFX/cowboy
Diffstat (limited to 'src')
-rw-r--r-- | src/cowboy_rest.erl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cowboy_rest.erl b/src/cowboy_rest.erl index 63e4dd9..5741dfe 100644 --- a/src/cowboy_rest.erl +++ b/src/cowboy_rest.erl @@ -52,7 +52,7 @@ %% Cached resource calls. etag :: undefined | no_call | {strong | weak, binary()}, last_modified :: undefined | no_call | calendar:datetime(), - expires :: undefined | no_call | calendar:datetime() + expires :: undefined | no_call | calendar:datetime() | binary() }). -spec upgrade(Req, Env, module(), any()) @@ -896,6 +896,10 @@ set_resp_expires(Req, State) -> case Expires of Expires when is_atom(Expires) -> {Req2, State2}; + Expires when is_binary(Expires) -> + Req3 = cowboy_req:set_resp_header( + <<"expires">>, Expires, Req2), + {Req3, State2}; Expires -> ExpiresBin = cowboy_clock:rfc1123(Expires), Req3 = cowboy_req:set_resp_header( |