MCPcopy Create free account
hub / github.com/apache/tomcat / removePathParameters

Method removePathParameters

java/org/apache/catalina/connector/Request.java:2025–2048  ·  view source on GitHub ↗
(String input)

Source from the content-addressed store, hash-verified

2023
2024
2025 private String removePathParameters(String input) {
2026 int nextSemiColon = input.indexOf(';');
2027 // Shortcut
2028 if (nextSemiColon == -1) {
2029 return input;
2030 }
2031 StringBuilder result = new StringBuilder(input.length());
2032 result.append(input, 0, nextSemiColon);
2033 while (true) {
2034 int nextSlash = input.indexOf('/', nextSemiColon);
2035 if (nextSlash == -1) {
2036 break;
2037 }
2038 nextSemiColon = input.indexOf(';', nextSlash);
2039 if (nextSemiColon == -1) {
2040 result.append(input.substring(nextSlash));
2041 break;
2042 } else {
2043 result.append(input, nextSlash, nextSemiColon);
2044 }
2045 }
2046
2047 return result.toString();
2048 }
2049
2050
2051 private int nextSlash(char[] uri, int startPos) {

Callers 1

getContextPathMethod · 0.95

Calls 4

lengthMethod · 0.80
toStringMethod · 0.65
indexOfMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected