diff --git a/src/component_handler.erl b/src/component_handler.erl index 5430d9a..b9da3bd 100644 --- a/src/component_handler.erl +++ b/src/component_handler.erl @@ -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; _ ->