From 4397a3c7fdcb7b7df0400b9d947ceb7670cb27b3 Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Mon, 8 Aug 2016 04:17:58 +0200 Subject: [PATCH] Use Response#content_type= --- src/kemal/helpers/helpers.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kemal/helpers/helpers.cr b/src/kemal/helpers/helpers.cr index e4943f0..d3ac682 100644 --- a/src/kemal/helpers/helpers.cr +++ b/src/kemal/helpers/helpers.cr @@ -51,7 +51,7 @@ end def send_file(env, path : String, mime_type : String? = nil) file_path = File.expand_path(path, Dir.current) mime_type = "application/octet-stream" unless mime_type - env.response.headers.add "Content-Type", mime_type + env.response.content_type = mime_type env.response.content_length = File.size(file_path) File.open(file_path) do |file| IO.copy(file, env.response)