Skip to content

Commit

Permalink
fixup! Use MIME in HTTP::StaticFileHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota committed Apr 6, 2018
1 parent a697080 commit 49c1543
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/http/server/handlers/static_file_handler.cr
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class HTTP::StaticFileHandler
end
end

context.response.content_type = MIME.fetch(File.extname(file_path), "application/octet-stream")
context.response.content_type = MIME.from_filename(file_path, "application/octet-stream")
context.response.content_length = File.size(file_path)
File.open(file_path) do |file|
IO.copy(file, context.response)
Expand Down

0 comments on commit 49c1543

Please sign in to comment.