In the Custom Code block within Automations, Base64-encoded strings are being altered by encoding the = character as =. This results in malformed Base64 output, which cannot be properly decoded unless manually corrected.
Steps to Reproduce:
Add a Custom Code block to an Automation.
Set or manipulate a string that ends with one or more = characters (e.g., a Base64 string like WA2lMCvHYiyreV6yal7kCg==).
Return or use the string in a webhook, custom field, or anywhere else within the automation.
Observe that = characters are transformed into =, resulting in: WA2lMCvHYiyreV6yal7kCg==.
Expected Behavior:
The string should remain unaltered and retain the = characters, which are essential for valid Base64 decoding.
Actual Behavior:
The = characters are HTML entity encoded to =, breaking compatibility with standard Base64 decoders.
Impact:
This affects use cases where Base64 is required — such as tokens, encrypted payloads, or signed strings — leading to integration errors or failed decoding.
Suggested Fix:
Do not HTML-encode characters like = in the output of Custom Code blocks, especially when the string is being programmatically handled.
Environment:
Platform: GoHighLevel
Feature: Automations → Custom Code block