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

Method doIsEncodeable

java/org/apache/catalina/connector/Response.java:1396–1413  ·  view source on GitHub ↗
(Context context, Request hreq, Session session, String location)

Source from the content-addressed store, hash-verified

1394
1395
1396 private static boolean doIsEncodeable(Context context, Request hreq, Session session, String location) {
1397 // Is this a valid absolute URL?
1398 URL url;
1399 try {
1400 URI uri = new URI(location);
1401 url = uri.toURL();
1402 } catch (MalformedURLException | URISyntaxException | IllegalArgumentException e) {
1403 return false;
1404 }
1405
1406 if (!RequestUtil.isSameWebApplication(hreq, url)) {
1407 return false;
1408 }
1409
1410 // Don't encode if the correct session ID is already present
1411 String tok = ";" + SessionConfig.getSessionUriParamName(context) + "=" + session.getIdInternal();
1412 return location.indexOf(tok) < 0;
1413 }
1414
1415
1416 /**

Callers 1

isEncodeableMethod · 0.95

Calls 4

isSameWebApplicationMethod · 0.95
getIdInternalMethod · 0.65
indexOfMethod · 0.45

Tested by

no test coverage detected