From e69bd400b706b9bc682e20c050100c12fe2e0398 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Tue, 7 May 2024 16:11:38 +0400 Subject: [PATCH] Directory Listing: Add UTF-8 Charset to the response Content type (#679) --- src/kemal/static_file_handler.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kemal/static_file_handler.cr b/src/kemal/static_file_handler.cr index dbeca28..11a3057 100644 --- a/src/kemal/static_file_handler.cr +++ b/src/kemal/static_file_handler.cr @@ -57,7 +57,7 @@ module Kemal end send_file(context, file_path) elsif config.is_a?(Hash) && config.fetch("dir_listing", false) - context.response.content_type = "text/html" + context.response.content_type = "text/html;charset=UTF-8;" directory_listing(context.response, request_path, file_path) else call_next(context)