Skip to content

Commit

Permalink
fix issue #140
Browse files Browse the repository at this point in the history
  • Loading branch information
vinoski committed Mar 8, 2013
1 parent 1ec97b0 commit 729b1e4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/yaws.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1457,10 +1457,14 @@ make_last_modified_header(FI) ->

make_expires_header(MimeType0, FI) ->
SC = get(sc),
[MimeType1|_] = yaws:split_sep(MimeType0, $;), %% Remove charset
case lists:keyfind(MimeType1, 1, SC#sconf.expires) of
{MimeType1, Type, TTL} -> make_expires_header(Type, TTL, FI);
false -> {undefined, undefined}
%% Use split_sep to remove charset
case yaws:split_sep(MimeType0, $;) of
[] -> {undefined, undefined};
[MimeType1|_] ->
case lists:keyfind(MimeType1, 1, SC#sconf.expires) of
{MimeType1, Type, TTL} -> make_expires_header(Type, TTL, FI);
false -> {undefined, undefined}
end
end.


Expand Down

0 comments on commit 729b1e4

Please sign in to comment.