Skip to content

Commit

Permalink
- Patch for the following crash:
Browse files Browse the repository at this point in the history
=ERROR REPORT==== 21-Feb-2013::12:02:48 ===
Yaws process died: {{badmatch,[]},
                    [{yaws,make_expires_header,2,
                           [{file,"src/yaws.erl"},{line,1460}]},
                     {yaws,outh_serialize,0,
                           [{file,"src/yaws.erl"},{line,1647}]},
                     {yaws_server,deliver_accumulated,4,
                                  [{file,"src/yaws_server.erl"},{line,3722}]},
                     {yaws_server,handle_ut,4,
                                  [{file,"src/yaws_server.erl"},{line,2188}]},
                     {yaws_server,aloop,4,
                                  [{file,"src/yaws_server.erl"},{line,1175}]},
                     {yaws_server,acceptor0,2,
                                  [{file,"src/yaws_server.erl"},{line,1016}]},
                     {proc_lib,init_p_do_apply,3,
                               [{file,"proc_lib.erl"},{line,227}]}]}

The crash occurs when Yaws can't find a corresponding mime-type
  • Loading branch information
Rudolph van Graan committed Feb 21, 2013
1 parent a7acf19 commit 8b1e443
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/yaws.erl
Expand Up @@ -1457,11 +1457,15 @@ make_last_modified_header(FI) ->


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




make_expires_header(access, TTL, _FI) -> make_expires_header(access, TTL, _FI) ->
Expand Down

0 comments on commit 8b1e443

Please sign in to comment.