From 4cc1472821d9f56938dcd5601f3478851f9200ab Mon Sep 17 00:00:00 2001 From: david gauchard Date: Mon, 15 Mar 2021 01:24:33 +0100 Subject: [PATCH] [BREAKING] base64::encode() compat with esp32: no newlines by default (#7910) --- cores/esp8266/base64.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/cores/esp8266/base64.h b/cores/esp8266/base64.h index 49a6cdfb0..d6857d1d2 100644 --- a/cores/esp8266/base64.h +++ b/cores/esp8266/base64.h @@ -33,11 +33,23 @@ public: // NOTE: The default behaviour of backend (lib64) // is to add a newline every 72 (encoded) characters output. // This may 'break' longer uris and json variables - static String encode(const uint8_t * data, size_t length, bool doNewLines = true); - static String inline encode(const String& text, bool doNewLines = true) + static String encode(const uint8_t * data, size_t length, bool doNewLines); + static inline String encode(const String& text, bool doNewLines) { return encode( (const uint8_t *) text.c_str(), text.length(), doNewLines ); } + + // esp32 compat: + + static inline String encode(const uint8_t * data, size_t length) + { + return encode(data, length, false); + } + + static inline String encode(const String& text) + { + return encode(text, false); + } private: };