[java-plugin-shibd] branch main updated: Adjust CharsetDecoder to match earlier default behavior.
Codeberg
noreply at shibboleth.net
Tue Jun 9 13:29:26 UTC 2026
This is an automated email from the git hooks/post-receive script.
codeberg pushed a commit to branch main
in repository java-plugin-shibd.
View the commit online:
https://codeberg.org/Shibboleth/java-plugin-shibd/commit/05ccd72377b4fd1d349a70ffaad9f4cdd8cd6db7
The following commit(s) were added to refs/heads/main by this push:
new 05ccd72 Adjust CharsetDecoder to match earlier default behavior.
05ccd72 is described below
commit 05ccd72377b4fd1d349a70ffaad9f4cdd8cd6db7
Author: Scott Cantor <scott at restingparrotsoftware.com>
AuthorDate: Tue Jun 9 09:29:10 2026 -0400
Adjust CharsetDecoder to match earlier default behavior.
---
.../net/shibboleth/sp/messaging/RemotedHttpServletRequest.java | 4 +++-
.../java/net/shibboleth/sp/profile/impl/DecodeAgentRequest.java | 8 ++++++--
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/sp-server-api/src/main/java/net/shibboleth/sp/messaging/RemotedHttpServletRequest.java b/sp-server-api/src/main/java/net/shibboleth/sp/messaging/RemotedHttpServletRequest.java
index 0ebab49..cce6241 100644
--- a/sp-server-api/src/main/java/net/shibboleth/sp/messaging/RemotedHttpServletRequest.java
+++ b/sp-server-api/src/main/java/net/shibboleth/sp/messaging/RemotedHttpServletRequest.java
@@ -200,7 +200,9 @@ public class RemotedHttpServletRequest implements HttpServletRequest {
/** {@inheritDoc} */
public void setCharacterEncoding(final String enc) throws UnsupportedEncodingException {
try {
- decoder = Charset.forName(enc).newDecoder();
+ decoder = Charset.forName(enc).newDecoder()
+ .onMalformedInput(CodingErrorAction.REPORT)
+ .onUnmappableCharacter(CodingErrorAction.REPORT);
} catch (final UnsupportedCharsetException e) {
throw new UnsupportedEncodingException();
}
diff --git a/sp-server-impl/src/main/java/net/shibboleth/sp/profile/impl/DecodeAgentRequest.java b/sp-server-impl/src/main/java/net/shibboleth/sp/profile/impl/DecodeAgentRequest.java
index 7f5d25e..dd61813 100644
--- a/sp-server-impl/src/main/java/net/shibboleth/sp/profile/impl/DecodeAgentRequest.java
+++ b/sp-server-impl/src/main/java/net/shibboleth/sp/profile/impl/DecodeAgentRequest.java
@@ -18,6 +18,8 @@ import jakarta.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.io.InputStream;
+import java.nio.charset.CharsetDecoder;
+import java.nio.charset.CodingErrorAction;
import javax.annotation.Nonnull;
@@ -116,9 +118,11 @@ public class DecodeAgentRequest extends AbstractAgentAction {
if (msg.isstruct()) {
final DDF httpreq = msg.getmember(RemotedHttpServletRequest.STRUCTURE_NAME);
if (httpreq.isstruct()) {
+ final CharsetDecoder decoder = ensureAgent().getCharacterEncoding().newDecoder()
+ .onMalformedInput(CodingErrorAction.REPORT)
+ .onUnmappableCharacter(CodingErrorAction.REPORT);
log.debug("{} Wrapping tunnelled HTTP request", getLogPrefix());
- agentContext.setRemotedHttpServletRequest(new RemotedHttpServletRequest(httpreq,
- ensureAgent().getCharacterEncoding().newDecoder()));
+ agentContext.setRemotedHttpServletRequest(new RemotedHttpServletRequest(httpreq, decoder));
}
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list