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:
parent
d3106f3fce
commit
651f3d8157
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user