Skip to content

Commit

Permalink
Mimetype dependent on file added to headers instead of hardcoded one.…
Browse files Browse the repository at this point in the history
… Missed that completly.
  • Loading branch information
Raoul Hess committed Nov 6, 2014
1 parent 17d2293 commit 6bf46a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/component_handler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ handle_get(Req, _State=#state{}) ->
error ->
cowboy_req:reply(500, Req3);
_ ->
Headers = [{<<"content-type">>, <<"text/javascript">>}],
{Mime, Type, []} = cow_mimetypes:all(File),
Headers = [{<<"content-type">>, << Mime/binary, "/", Type/binary >>}],
cowboy_req:reply(200, Headers, FileBin, Req3)
end;
_ ->
Expand Down

0 comments on commit 6bf46a8

Please sign in to comment.