pretty_retrieve: use match_filname to match MIME
fixes pastes which had JSON, Bash, etc. content. Signed-off-by: Gunwant Jain <mail@wantguns.dev>
This commit is contained in:
@@ -35,7 +35,7 @@ fn pretty_retrieve(id: PasteId) -> Option<Template> {
|
||||
map.insert("code", contents);
|
||||
let rendered = Template::render("pretty", &map);
|
||||
|
||||
match tree_magic::from_filepath(filepath).contains("text") {
|
||||
match tree_magic::match_filepath("text/plain", filepath) {
|
||||
true => Some(rendered),
|
||||
false => None
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user