[cpp-sp] 01/02: Fix comma handling when logging exceptions.
Codeberg
noreply at shibboleth.net
Mon Jun 1 15:20:55 UTC 2026
This is an automated email from the git hooks/post-receive script.
codeberg pushed a commit to branch main
in repository cpp-sp.
View the commit online:
https://codeberg.org/Shibboleth/cpp-sp/commit/9060b029fa301b6206ebabefb7f5663b433393e7
commit 9060b029fa301b6206ebabefb7f5663b433393e7
Author: Scott Cantor <scott at restingparrotsoftware.com>
AuthorDate: Mon Jun 1 11:20:29 2026 -0400
Fix comma handling when logging exceptions.
---
shibsp/AbstractSPRequest.cpp | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/shibsp/AbstractSPRequest.cpp b/shibsp/AbstractSPRequest.cpp
index 3dfa968f..18b588f9 100644
--- a/shibsp/AbstractSPRequest.cpp
+++ b/shibsp/AbstractSPRequest.cpp
@@ -472,13 +472,22 @@ void AbstractSPRequest::log(Priority::Value level, const exception& e) const
ostringstream msg;
msg << e.what() << " [";
+ bool needComma = false;
+
// Dump properties and status code.
if (rich_ex->getStatusCode() != 0) {
msg << "status=" << rich_ex->getStatusCode();
+ bool needComma = true;
}
for (const auto& prop : rich_ex->getProperties()) {
- msg << ", " << prop.first << '=' << prop.second;
+ if (needComma) {
+ msg << ", ";
+ }
+ else {
+ needComma = true;
+ }
+ msg << prop.first << '=' << prop.second;
}
msg << ']';
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list