(Context context, Request hreq, Session session, String location)
| 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 | /** |
no test coverage detected