-
Improvement
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
-
2 - Long term
-
2 - Normal
In the code of org.ametys.cms.transformation.ConsistencyChecker._checkHTTPLink(String, boolean), we have:
try { CookieHandler.setDefault(new CookieManager(null, CookiePolicy.ACCEPT_ALL)); [... some code ...] } finally { ((CookieManager) CookieHandler.getDefault()).getCookieStore().removeAll(); }
Several problems:
- CookieHandler is set to a default cookie manager but never restored to its old value, also it means that if other APIs call the CookieHandler, the cookie manager can be modified.
- The cookie manager is reinstanciate each time it is used (so as many there are links)
- Cookie store is emptied:
- Not through its initial implementation: I think URL check is threaded so we can have conflicts between all instanciations.
- Maybe we could kept the cookie store for all links to check and restore it at the end.