ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [2/4] ignite git commit: Fixed IGNITE-6070 "Ensure that Web Session RequestWrapper considers its sessions valid".
Date Mon, 11 Sep 2017 07:45:36 GMT
Fixed IGNITE-6070 "Ensure that Web Session RequestWrapper considers its sessions valid".


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d808e33e
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d808e33e
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d808e33e

Branch: refs/heads/ignite-5896
Commit: d808e33efc950d70975a69d51fd6fc6de0613656
Parents: 72d9f79
Author: Ilya Kasnacheev <ilya.kasnacheev@gmail.com>
Authored: Fri Sep 8 18:16:16 2017 +0300
Committer: Tikhonov Nikolay <tikhonovnicolay@gmail.com>
Committed: Fri Sep 8 18:16:16 2017 +0300

----------------------------------------------------------------------
 .../ignite/cache/websession/WebSessionFilter.java       | 12 +++++++++++-
 .../ignite/internal/websession/WebSessionSelfTest.java  |  2 ++
 2 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/d808e33e/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSessionFilter.java
----------------------------------------------------------------------
diff --git a/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSessionFilter.java
b/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSessionFilter.java
index 6cbf575..0112413 100644
--- a/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSessionFilter.java
+++ b/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSessionFilter.java
@@ -975,6 +975,11 @@ public class WebSessionFilter implements Filter {
             this.ses.filter(WebSessionFilter.this);
             this.ses.resetUpdates();
         }
+
+        /** {@inheritDoc} */
+        @Override public boolean isRequestedSessionIdValid() {
+            return ses.isValid();
+        }
     }
 
     /**
@@ -998,7 +1003,7 @@ public class WebSessionFilter implements Filter {
 
         /** {@inheritDoc} */
         @Override public HttpSession getSession(boolean create) {
-            if (!ses.isValid()) {
+            if (ses != null && !ses.isValid()) {
                 binaryCache.remove(ses.id());
 
                 if (create) {
@@ -1056,5 +1061,10 @@ public class WebSessionFilter implements Filter {
                 }
             }
         }
+
+        /** {@inheritDoc} */
+        @Override public boolean isRequestedSessionIdValid() {
+            return ses != null && ses.isValid();
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/d808e33e/modules/web/src/test/java/org/apache/ignite/internal/websession/WebSessionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/web/src/test/java/org/apache/ignite/internal/websession/WebSessionSelfTest.java
b/modules/web/src/test/java/org/apache/ignite/internal/websession/WebSessionSelfTest.java
index 2171f67..e566624 100644
--- a/modules/web/src/test/java/org/apache/ignite/internal/websession/WebSessionSelfTest.java
+++ b/modules/web/src/test/java/org/apache/ignite/internal/websession/WebSessionSelfTest.java
@@ -1168,6 +1168,8 @@ public class WebSessionSelfTest extends GridCommonAbstractTest {
             throws ServletException, IOException {
             HttpSession ses = req.getSession(true);
 
+            assertTrue(req.isRequestedSessionIdValid());
+
             sesId.compareAndSet(null, ses.getId());
 
             Integer attr = (Integer)ses.getAttribute("attr");


Mime
View raw message