Permalink
Browse files

HTTP headers without Content-Type

When the HTTP response headers did not include a Content-Type, the fsm
would crash. Use a default type of "text/plain" in this case.
  • Loading branch information...
1 parent b3f672e commit ce2fb01e8b59515dc9158b4cb070d58d7f06c4de @msantos committed Sep 17, 2010
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/pervon.erl
View
@@ -160,6 +160,8 @@ filename(Path, Type, Name, Subtype) ->
integer_to_list(A) ++ integer_to_list(B) ++ integer_to_list(C) ++
"." ++ Subtype.
+content_type(undefined) ->
+ {"text", "txt"};
content_type(String) ->
type(hd(string:tokens(String, ";"))).

0 comments on commit ce2fb01

Please sign in to comment.