MCPcopy Index your code
hub / github.com/apache/tomcat / encodeURL

Method encodeURL

java/org/apache/catalina/connector/Response.java:1103–1127  ·  view source on GitHub ↗
(String url)

Source from the content-addressed store, hash-verified

1101
1102
1103 @Override
1104 public String encodeURL(String url) {
1105
1106 String absolute;
1107 try {
1108 absolute = toAbsolute(url);
1109 } catch (IllegalArgumentException iae) {
1110 // URL construction failed
1111 return url;
1112 }
1113
1114 if (isEncodeable(absolute)) {
1115 Session session = request.getSessionInternal();
1116 if (session != null) {
1117 // W3c spec clearly said
1118 if (url.equalsIgnoreCase("")) {
1119 url = absolute;
1120 } else if (url.equals(absolute) && !hasPath(url)) {
1121 url += '/';
1122 }
1123 return toEncoded(url, session.getIdInternal());
1124 }
1125 }
1126 return url;
1127 }
1128
1129
1130 /**

Callers 3

doTestEncodeURLMethod · 0.95
testBug53469aMethod · 0.95
testBug53469bMethod · 0.95

Calls 8

toAbsoluteMethod · 0.95
isEncodeableMethod · 0.95
hasPathMethod · 0.95
toEncodedMethod · 0.95
getIdInternalMethod · 0.95
getSessionInternalMethod · 0.80
equalsMethod · 0.65
equalsIgnoreCaseMethod · 0.45

Tested by 3

doTestEncodeURLMethod · 0.76
testBug53469aMethod · 0.76
testBug53469bMethod · 0.76