From 6a7e5aacdde891fa01a0e0ad00a94492f67dd9b1 Mon Sep 17 00:00:00 2001 From: Yunze Xu Date: Thu, 2 Apr 2026 15:54:41 +0800 Subject: [PATCH] Fix broken CI due to token string not trimmed --- tests/AuthTokenTest.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/AuthTokenTest.cc b/tests/AuthTokenTest.cc index 4bfd8085..4749683f 100644 --- a/tests/AuthTokenTest.cc +++ b/tests/AuthTokenTest.cc @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -45,6 +46,9 @@ static const std::string tokenPath = TOKEN_PATH; std::string getToken() { std::ifstream file(tokenPath); std::string str((std::istreambuf_iterator(file)), std::istreambuf_iterator()); + while (!str.empty() && isspace(str.back())) { + str.pop_back(); + } return str; }