mirror of
https://github.com/gchq/CyberChef.git
synced 2024-11-02 14:11:02 +01:00
Updated variable scope in legacy HTTP.js file
This commit is contained in:
parent
83c145c2ac
commit
67bd2605c0
@ -45,18 +45,18 @@ const HTTP = {
|
||||
* @returns {string}
|
||||
*/
|
||||
runDechunk: function(input, args) {
|
||||
var chunks = [];
|
||||
var chunkSizeEnd = input.indexOf("\n") + 1;
|
||||
var lineEndings = input.charAt(chunkSizeEnd - 2) == "\r" ? "\r\n" : "\n";
|
||||
var lineEndingsLength = lineEndings.length;
|
||||
var chunkSize = parseInt(input.slice(0, chunkSizeEnd), 16);
|
||||
let chunks = [];
|
||||
let chunkSizeEnd = input.indexOf("\n") + 1;
|
||||
let lineEndings = input.charAt(chunkSizeEnd - 2) === "\r" ? "\r\n" : "\n";
|
||||
let lineEndingsLength = lineEndings.length;
|
||||
let chunkSize = parseInt(input.slice(0, chunkSizeEnd), 16);
|
||||
while (!isNaN(chunkSize)) {
|
||||
chunks.push(input.slice(chunkSizeEnd, chunkSize + chunkSizeEnd));
|
||||
input = input.slice(chunkSizeEnd + chunkSize + lineEndingsLength);
|
||||
chunkSizeEnd = input.indexOf(lineEndings) + lineEndingsLength;
|
||||
chunkSize = parseInt(input.slice(0, chunkSizeEnd), 16);
|
||||
}
|
||||
return chunks.join('') + input;
|
||||
return chunks.join("") + input;
|
||||
},
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user