Skip to content

Commit

Permalink
allow expires */*
Browse files Browse the repository at this point in the history
  • Loading branch information
andreineculau committed Mar 22, 2015
1 parent 1075411 commit eadc686
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/yaws.erl
Expand Up @@ -1505,6 +1505,12 @@ make_last_modified_header(FI) ->
["Last-Modified: ", local_time_as_gmt_string(Then), "\r\n"].


make_expires_header("*/*", FI) ->
SC = get(sc),
case lists:keyfind("*/*", 1, SC#sconf.expires) of
{_MimeType, Type, TTL} -> make_expires_header(Type, TTL, FI);
false -> {undefined, undefined}
end;
make_expires_header(MimeType0, FI) ->
SC = get(sc),
%% Use split_sep to remove charset
Expand All @@ -1513,7 +1519,7 @@ make_expires_header(MimeType0, FI) ->
[MimeType1|_] ->
case lists:keyfind(MimeType1, 1, SC#sconf.expires) of
{MimeType1, Type, TTL} -> make_expires_header(Type, TTL, FI);
false -> {undefined, undefined}
false -> make_expires_header("*/*", FI)
end
end.

Expand Down

0 comments on commit eadc686

Please sign in to comment.