mirror of
https://github.com/gchq/CyberChef.git
synced 2024-11-02 22:21:01 +01:00
ESM: Fixed magic errors
This commit is contained in:
parent
37c8d1b7ea
commit
a0f034b843
@ -231,8 +231,10 @@ class Magic {
|
||||
const conf = {
|
||||
op: op,
|
||||
args: [encodings[i]]
|
||||
},
|
||||
data = await this._runRecipe([conf], sample.buffer);
|
||||
};
|
||||
|
||||
try {
|
||||
const data = await this._runRecipe([conf], sample.buffer);
|
||||
|
||||
// Only add to the results if it changed the data
|
||||
if (!_buffersEqual(data, sample.buffer)) {
|
||||
@ -241,6 +243,9 @@ class Magic {
|
||||
conf: conf
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -356,8 +361,9 @@ class Magic {
|
||||
* @returns {ArrayBuffer}
|
||||
*/
|
||||
async _runRecipe(recipeConfig, input=this.inputBuffer) {
|
||||
input = input instanceof ArrayBuffer ? input : input.buffer;
|
||||
const dish = new Dish();
|
||||
dish.set(input.buffer, Dish.ARRAY_BUFFER);
|
||||
dish.set(input, Dish.ARRAY_BUFFER);
|
||||
|
||||
if (ENVIRONMENT_IS_WORKER()) self.loadRequiredModules(recipeConfig);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user