Skip to content

Commit aaa27d0

Browse files
committed
Make guessing content type from files more robust
1 parent 9f0268b commit aaa27d0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ring-core/src/ring/middleware/content_type.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
(defn- guess-mime-type [{:keys [uri]} {:keys [body]} mime-types]
77
(or (ext-mime-type uri mime-types)
88
(when (instance? java.io.File body)
9-
(ext-mime-type (str body) mime-types))))
9+
(ext-mime-type (.getAbsolutePath ^java.io.File body) mime-types))))
1010

1111
(defn content-type-response
1212
"Adds a content-type header to response. See: wrap-content-type."

0 commit comments

Comments
 (0)