This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 0dc38c964fc2d9aaddbb9564fff33551e74a6585 Author: Mark Thomas <ma...@apache.org> AuthorDate: Thu Feb 23 16:41:59 2023 +0000 Use i18n --- java/org/apache/catalina/connector/CoyoteAdapter.java | 8 ++++---- java/org/apache/catalina/connector/LocalStrings.properties | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java b/java/org/apache/catalina/connector/CoyoteAdapter.java index 104a83f3e4..9c0d524489 100644 --- a/java/org/apache/catalina/connector/CoyoteAdapter.java +++ b/java/org/apache/catalina/connector/CoyoteAdapter.java @@ -639,7 +639,7 @@ public class CoyoteAdapter implements Adapter { connector.getService().getContainer().logAccess(request, response, 0, true); return false; } else { - response.sendError(400, "Invalid URI"); + response.sendError(400, sm.getString("coyoteAdapter.invalidURI")); } } @@ -662,7 +662,7 @@ public class CoyoteAdapter implements Adapter { try { req.getURLDecoder().convert(decodedURI.getByteChunk(), connector.getEncodedSolidusHandlingInternal()); } catch (IOException ioe) { - response.sendError(400, "Invalid URI: " + ioe.getMessage()); + response.sendError(400, sm.getString("coyoteAdapter.invalidURIWithMessage", ioe.getMessage())); } // Normalization if (normalize(req.decodedURI())) { @@ -673,7 +673,7 @@ public class CoyoteAdapter implements Adapter { response.sendError(400, "Invalid URI"); } } else { - response.sendError(400, "Invalid URI"); + response.sendError(400, sm.getString("coyoteAdapter.invalidURI")); } } else { /* The URI is chars or String, and has been sent using an in-memory @@ -869,7 +869,7 @@ public class CoyoteAdapter implements Adapter { if (header != null) { res.addHeader("Allow", header); } - response.sendError(405, "TRACE method is not allowed"); + response.sendError(405, sm.getString("coyoteAdapter.trace")); // Safe to skip the remainder of this method. return true; } diff --git a/java/org/apache/catalina/connector/LocalStrings.properties b/java/org/apache/catalina/connector/LocalStrings.properties index 7d09d69279..f511e2e836 100644 --- a/java/org/apache/catalina/connector/LocalStrings.properties +++ b/java/org/apache/catalina/connector/LocalStrings.properties @@ -21,7 +21,10 @@ coyoteAdapter.checkRecycled.request=Encountered a non-recycled request and recyc coyoteAdapter.checkRecycled.response=Encountered a non-recycled response and recycled it forcedly. coyoteAdapter.connect=HTTP requests using the CONNECT method are not supported coyoteAdapter.debug=The variable [{0}] has value [{1}] +coyoteAdapter.invalidURI=Invalid URI +coyoteAdapter.invalidURIWithMessage=Invalid URI: [{0}] coyoteAdapter.nullRequest=An asynchronous dispatch may only happen on an existing request +coyoteAdapter.trace=TRACE method is not allowed coyoteConnector.invalidEncoding=The encoding [{0}] is not recognised by the JRE. The Connector will continue to use [{1}] coyoteConnector.invalidPort=The connector cannot start since the specified port value of [{0}] is invalid --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org