mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-11 00:31:31 -04:00
Slight modification to how we match the mime
This commit is contained in:
parent
ee37731858
commit
730ee4f660
2 changed files with 4 additions and 7 deletions
|
@ -5,7 +5,7 @@ import Dish from "../Dish.mjs";
|
||||||
import {detectFileType} from "./FileType.mjs";
|
import {detectFileType} from "./FileType.mjs";
|
||||||
import chiSquared from "chi-squared";
|
import chiSquared from "chi-squared";
|
||||||
import potentialOps from "./Test.mjs";
|
import potentialOps from "./Test.mjs";
|
||||||
import { isImage } from "./FileType.mjs";
|
import { isType } from "./FileType.mjs";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A class for detecting encodings, file types and byte frequencies and
|
* A class for detecting encodings, file types and byte frequencies and
|
||||||
|
@ -253,11 +253,8 @@ class Magic {
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
async checkMime (data, type) {
|
async checkMime (data, type) {
|
||||||
switch (type) {
|
if (isType(type, data)) {
|
||||||
case "Image":
|
return false;
|
||||||
if (isImage(data))
|
|
||||||
return false;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ class RenderImage extends Operation {
|
||||||
],
|
],
|
||||||
null,
|
null,
|
||||||
{
|
{
|
||||||
type: "Image",
|
type: "image"
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue