Commit 19f229be authored by amirouche's avatar amirouche

mime-types: for some reason it stopped working

parent 51a30577
......@@ -542,10 +542,8 @@
(define (file-extension file-name)
"Return the file extension for FILE-NAME, or #f if one is not
found."
(and=> (regexp-exec %file-ext-regexp file-name)
(lambda (match)
(or (match:substring match 2)
(match:substring match 1)))))
(let ((strings (string-split file-name #\.)))
(list-ref strings (- (length strings) 1))))
(define-public (mime-type file-name)
"Guess the MIME type for FILE-NAME based upon its file extension."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment