aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2014-06-10 08:38:54 +0200
committerLoïc Hoguin <[email protected]>2014-06-10 08:39:40 +0200
commitfc7e038fbab8ad1b5b11548f9d009c1b6ccd4be3 (patch)
tree4fc8ce506d07f8acf08ed545aaf0df18dbcd9d06 /src
parent7a808e0aa3e764d923da74e18f76790936d19a35 (diff)
parent6ed25fd60b0cc502ae79baf20456bb2d2b02973e (diff)
downloadcowboy-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.erl6
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(