This is an automated email from the ASF dual-hosted git repository.
xyz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-client-cpp.git
The following commit(s) were added to refs/heads/main by this push:
new e5afb63 Fix broken CI due to token string not trimmed (#565)
e5afb63 is described below
commit e5afb63dc24d5ebccaf0ff5108106adc8d83bdcb
Author: Yunze Xu <[email protected]>
AuthorDate: Thu Apr 2 17:41:50 2026 +0800
Fix broken CI due to token string not trimmed (#565)
---
tests/AuthTokenTest.cc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/AuthTokenTest.cc b/tests/AuthTokenTest.cc
index 4bfd808..4749683 100644
--- a/tests/AuthTokenTest.cc
+++ b/tests/AuthTokenTest.cc
@@ -22,6 +22,7 @@
#include <pulsar/Client.h>
#include <boost/algorithm/string.hpp>
+#include <cctype>
#include <fstream>
#include <streambuf>
#include <string>
@@ -45,6 +46,9 @@ static const std::string tokenPath = TOKEN_PATH;
std::string getToken() {
std::ifstream file(tokenPath);
std::string str((std::istreambuf_iterator<char>(file)),
std::istreambuf_iterator<char>());
+ while (!str.empty() && isspace(str.back())) {
+ str.pop_back();
+ }
return str;
}