mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-09 07:45:00 -04:00
fixing indent
This commit is contained in:
parent
ed17ed2919
commit
13b10a68a2
1 changed files with 152 additions and 151 deletions
|
@ -4,16 +4,17 @@
|
|||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
import Operation from "../Operation";
|
||||
import OperationError from "../errors/OperationError";
|
||||
import cptable from "../vendor/js-codepage/cptable.js";
|
||||
import {fromBase64} from "../lib/Base64";
|
||||
import {decodeQuotedPrintable} from "../lib/QuotedPrintable"
|
||||
import {MIME_FORMAT} from "../lib/ChrEnc";
|
||||
import Operation from "../Operation";
|
||||
import OperationError from "../errors/OperationError";
|
||||
import cptable from "../vendor/js-codepage/cptable.js";
|
||||
import {fromBase64} from "../lib/Base64";
|
||||
import {decodeQuotedPrintable} from "../lib/QuotedPrintable";
|
||||
import {MIME_FORMAT} from "../lib/ChrEnc";
|
||||
import Utils from "../Utils";
|
||||
|
||||
|
||||
//TODO: fix function header
|
||||
/**
|
||||
// TODO: fix function header
|
||||
/**
|
||||
* Return the conetent encoding for a mime section from a header object.
|
||||
* CONTENT_TYPE returns the content type of a mime header from a header object.
|
||||
* Returns the filename from a mime header object.
|
||||
|
@ -21,25 +22,25 @@
|
|||
* @constant
|
||||
* @default
|
||||
*/
|
||||
const FIELD_ITEM = {
|
||||
const FIELD_ITEM = {
|
||||
FILENAME: [/filename=".*?([^~#%&*\][\\:<>?/|]+)"/, "content-disposition"],
|
||||
CONTENT_TYPE: [/\s*([^;\s]+)/, "content-type"],
|
||||
BOUNDARY: [/boundary="(.+?)"/, "content-type"],
|
||||
CHARSET: [/charset=([a-z0-9-]+)/, "content-type"],
|
||||
TRANSER_ENCODING: [/\s*([A-Za-z0-9-]+)\s*/, "content-transfer-encoding"],
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* @constant
|
||||
* @default
|
||||
*/
|
||||
//TODO: should 8 bit and 7 bit be treated the same?
|
||||
const DECODER = {
|
||||
// TODO: should 8 bit and 7 bit be treated the same?
|
||||
const DECODER = {
|
||||
"base64": function (input) {
|
||||
return fromBase64(input, Base64.ALPHABET, "string", true);
|
||||
return fromBase64(input);
|
||||
},
|
||||
"quoted-printable": function (input) {
|
||||
return decodeQuotedPrintable(input);
|
||||
return Utils.byteArrayToUtf8(decodeQuotedPrintable(input));
|
||||
},
|
||||
"7bit": function (input) {
|
||||
return input;
|
||||
|
@ -47,10 +48,10 @@
|
|||
"8bit": function (input) {
|
||||
return input;
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class ParseIMF extends Operation {
|
||||
class ParseIMF extends Operation {
|
||||
|
||||
/**
|
||||
* Internet MessageFormat constructor
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue