mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-15 20:50:24 +00:00
Merge branch 'binary-expires' of git://github.com/NineFX/cowboy
This commit is contained in:
commit
fc7e038fba
4 changed files with 32 additions and 2 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue