Browse files

fix issue #140

  • Loading branch information...
1 parent 1ec97b0 commit 729b1e445d6179732de847384708c8d95c9f121d @vinoski vinoski committed Mar 8, 2013
Showing with 8 additions and 4 deletions.
  1. +8 −4 src/yaws.erl
View
12 src/yaws.erl
@@ -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.

0 comments on commit 729b1e4

Please sign in to comment.