From 9b53cf362ef9787c8deee91d9e280977ff03b8bd Mon Sep 17 00:00:00 2001 From: hayzamjs Date: Wed, 25 Dec 2024 12:38:15 +0400 Subject: [PATCH] tests: fix TestGetContentType --- utils/strings.go | 1 + utils/strings_test.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/strings.go b/utils/strings.go index f84d257..f978317 100644 --- a/utils/strings.go +++ b/utils/strings.go @@ -134,6 +134,7 @@ func GetContentType(filename string) string { if contentType, ok := contentTypes[ext]; ok { return contentType } + return "application/octet-stream" } diff --git a/utils/strings_test.go b/utils/strings_test.go index 4a1b610..a8ee540 100644 --- a/utils/strings_test.go +++ b/utils/strings_test.go @@ -507,7 +507,7 @@ func TestGetContentType(t *testing.T) { {"photo.jpeg", "image/jpeg"}, {"animation.gif", "image/gif"}, {"icon.svg", "image/svg+xml"}, - {"document.pdf", "application/octet-stream"}, + {"document.pdf", "application/pdf"}, {"FILE.HTML", "text/html"}, {"path/to/file.CSS", "text/css"}, }