Tests: adjusted inactive interval in Java app for slow hosts.

This commit is contained in:
Andrey Zelenkov
2019-07-02 16:44:08 +03:00
parent 29225c4fc6
commit bcb9048c46
2 changed files with 19 additions and 5 deletions

View File

@@ -17,7 +17,13 @@ public class app extends HttpServlet
HttpSession s = request.getSession();
if (s.isNew()) {
s.setMaxInactiveInterval(2);
String interval = request.getHeader("X-Interval");
if (interval == null) {
s.setMaxInactiveInterval(0);
} else {
s.setMaxInactiveInterval(Integer.parseInt(interval));
}
}
response.addHeader("X-Session-Id", s.getId());