You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2021/01/27 10:13:42 UTC
[tomcat] branch 9.0.x updated: Code reformatting / clean-up
primarily to trigger CI build
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
The following commit(s) were added to refs/heads/9.0.x by this push:
new 2de8d21 Code reformatting / clean-up primarily to trigger CI build
2de8d21 is described below
commit 2de8d217fdb0896813ada3232b2d6084ac6a38b8
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Jan 27 10:09:03 2021 +0000
Code reformatting / clean-up primarily to trigger CI build
---
java/org/apache/catalina/servlets/CGIServlet.java | 34 ++++++++---------------
1 file changed, 11 insertions(+), 23 deletions(-)
diff --git a/java/org/apache/catalina/servlets/CGIServlet.java b/java/org/apache/catalina/servlets/CGIServlet.java
index 98672ad..dc928f1 100644
--- a/java/org/apache/catalina/servlets/CGIServlet.java
+++ b/java/org/apache/catalina/servlets/CGIServlet.java
@@ -800,8 +800,8 @@ public final class CGIServlet extends HttpServlet {
// does not contain an unencoded "=" this is an indexed query.
// The parsed query string becomes the command line parameters
// for the cgi command.
- if (enableCmdLineArguments && (req.getMethod().equals("GET")
- || req.getMethod().equals("POST") || req.getMethod().equals("HEAD"))) {
+ if (enableCmdLineArguments && (req.getMethod().equals("GET") || req.getMethod().equals("POST") ||
+ req.getMethod().equals("HEAD"))) {
String qs;
if (isIncluded) {
qs = (String) req.getAttribute(
@@ -1013,10 +1013,7 @@ public final class CGIServlet extends HttpServlet {
sCGIFullName = sCGINames[2];
sCGIName = sCGINames[3];
- if (sCGIFullPath == null
- || sCGIScriptName == null
- || sCGIFullName == null
- || sCGIName == null) {
+ if (sCGIFullPath == null || sCGIScriptName == null || sCGIFullName == null || sCGIName == null) {
return false;
}
@@ -1049,8 +1046,7 @@ public final class CGIServlet extends HttpServlet {
* (see method findCGI, where the real work is done)
*
*/
- if (pathInfo == null
- || (pathInfo.substring(sCGIFullName.length()).length() <= 0)) {
+ if (pathInfo == null || (pathInfo.substring(sCGIFullName.length()).length() <= 0)) {
sPathInfoCGI = "";
} else {
sPathInfoCGI = pathInfo.substring(sCGIFullName.length());
@@ -1386,9 +1382,7 @@ public final class CGIServlet extends HttpServlet {
*/
protected String blanksToString(String couldBeBlank,
String subForBlanks) {
- return (couldBeBlank == null || couldBeBlank.isEmpty())
- ? subForBlanks
- : couldBeBlank;
+ return (couldBeBlank == null || couldBeBlank.isEmpty()) ? subForBlanks : couldBeBlank;
}
@@ -1469,11 +1463,7 @@ public final class CGIServlet extends HttpServlet {
* Checks and sets ready status
*/
protected void updateReadyStatus() {
- if (command != null
- && env != null
- && wd != null
- && params != null
- && response != null) {
+ if (command != null && env != null && wd != null && params != null && response != null) {
readyToRun = true;
} else {
readyToRun = false;
@@ -1609,13 +1599,11 @@ public final class CGIServlet extends HttpServlet {
log.debug("envp: [" + env + "], command: [" + command + "]");
}
- if ((command.contains(File.separator + "." + File.separator))
- || (command.contains(File.separator + ".."))
- || (command.contains(".." + File.separator))) {
- throw new IOException(this.getClass().getName()
- + "Illegal Character in CGI command "
- + "path ('.' or '..') detected. Not "
- + "running CGI [" + command + "].");
+ if ((command.contains(File.separator + "." + File.separator)) ||
+ (command.contains(File.separator + "..")) ||
+ (command.contains(".." + File.separator))) {
+ throw new IOException(this.getClass().getName() + "Illegal Character in CGI command path " +
+ "('.' or '..') detected. Not running CGI [" + command + "].");
}
/* original content/structure of this section taken from
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org