This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 559606f331063be1bc7575f85d39e1c1efec995c 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 fc1f3b54de..4c9a08f576 100644 --- a/java/org/apache/catalina/connector/CoyoteAdapter.java +++ b/java/org/apache/catalina/connector/CoyoteAdapter.java @@ -632,7 +632,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")); } } @@ -655,7 +655,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())) { @@ -669,7 +669,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 @@ -865,7 +865,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 b6c5ca936b..eba56eb075 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