mirror of
https://github.com/gchq/CyberChef
synced 2025-03-14 22:06:56 +00:00
uppercase constant
This commit is contained in:
parent
afb9fd8408
commit
c19fe5cffa
1 changed files with 2 additions and 2 deletions
|
@ -65,10 +65,10 @@ class URLEncode extends Operation {
|
|||
* @returns {string}
|
||||
*/
|
||||
encodeAllSpecialChars (str) {
|
||||
const specialChars = "!#'()*-._~";
|
||||
const SPECIAL_CHARS = "!#'()*-._~";
|
||||
let encoded = "";
|
||||
for (const char of str) {
|
||||
if (encodeURIComponent(char) === char && specialChars.includes(char)) {
|
||||
if (encodeURIComponent(char) === char && SPECIAL_CHARS.includes(char)) {
|
||||
encoded += "%" + this.frontPad(char.charCodeAt(0).toString(16).toUpperCase(), 2, "0");
|
||||
} else {
|
||||
encoded += encodeURIComponent(char);
|
||||
|
|
Loading…
Add table
Reference in a new issue