mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 06:55:08 -04: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
Add a link
Reference in a new issue