Skip to content

Commit e5afb63

Browse files
Fix broken CI due to token string not trimmed (#565)
1 parent 00c4daa commit e5afb63

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/AuthTokenTest.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <pulsar/Client.h>
2323

2424
#include <boost/algorithm/string.hpp>
25+
#include <cctype>
2526
#include <fstream>
2627
#include <streambuf>
2728
#include <string>
@@ -45,6 +46,9 @@ static const std::string tokenPath = TOKEN_PATH;
4546
std::string getToken() {
4647
std::ifstream file(tokenPath);
4748
std::string str((std::istreambuf_iterator<char>(file)), std::istreambuf_iterator<char>());
49+
while (!str.empty() && isspace(str.back())) {
50+
str.pop_back();
51+
}
4852
return str;
4953
}
5054

0 commit comments

Comments
 (0)