You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by so...@apache.org on 2018/11/20 05:49:18 UTC
[openmeetings] branch 4.0.x updated: [OPENMEETINGS-1931] Hack with
session cookie is removed
This is an automated email from the ASF dual-hosted git repository.
solomax pushed a commit to branch 4.0.x
in repository https://gitbox.apache.org/repos/asf/openmeetings.git
The following commit(s) were added to refs/heads/4.0.x by this push:
new 6657395 [OPENMEETINGS-1931] Hack with session cookie is removed
6657395 is described below
commit 665739554ff68759c1593642261561efc9f0a2c0
Author: Maxim Solodovnik <so...@gmail.com>
AuthorDate: Tue Nov 20 12:49:08 2018 +0700
[OPENMEETINGS-1931] Hack with session cookie is removed
---
.../openmeetings/db/util/ApplicationHelper.java | 11 +---------
.../apache/openmeetings/web/app/Application.java | 24 +++++++++-------------
2 files changed, 11 insertions(+), 24 deletions(-)
diff --git a/openmeetings-db/src/main/java/org/apache/openmeetings/db/util/ApplicationHelper.java b/openmeetings-db/src/main/java/org/apache/openmeetings/db/util/ApplicationHelper.java
index fe04331..de8cf6f 100644
--- a/openmeetings-db/src/main/java/org/apache/openmeetings/db/util/ApplicationHelper.java
+++ b/openmeetings-db/src/main/java/org/apache/openmeetings/db/util/ApplicationHelper.java
@@ -26,7 +26,6 @@ import static org.springframework.web.context.support.WebApplicationContextUtils
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
-import javax.servlet.SessionCookieConfig;
import org.apache.openmeetings.IApplication;
import org.apache.openmeetings.IWebSession;
@@ -45,7 +44,6 @@ import org.apache.wicket.protocol.http.servlet.ServletWebRequest;
import org.apache.wicket.request.cycle.RequestCycle;
import org.apache.wicket.request.cycle.RequestCycleContext;
import org.slf4j.Logger;
-import org.springframework.mock.web.MockSessionCookieConfig;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.XmlWebApplicationContext;
@@ -76,14 +74,7 @@ public class ApplicationHelper {
log.error("Failed to create Application");
return null;
}
- app.setServletContext(new MockServletContext(app, null) {
- @Override
- public SessionCookieConfig getSessionCookieConfig() {
- SessionCookieConfig cfg = new MockSessionCookieConfig();
- cfg.setName("_ensureApplication"); // FIXME TODO WICKET-6588
- return cfg;
- }
- });
+ app.setServletContext(new MockServletContext(app, null));
app.setName(getWicketApplicationName());
ServletContext sc = app.getServletContext();
OMContextListener omcl = new OMContextListener();
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/Application.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/Application.java
index 294c1fc..1151b16 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/Application.java
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/Application.java
@@ -155,19 +155,15 @@ public class Application extends AuthenticatedWebApplication implements IApplica
getSecuritySettings().setAuthenticationStrategy(new OmAuthenticationStrategy());
getApplicationSettings().setAccessDeniedPage(AccessDeniedPage.class);
- // FIXME TODO WICKET-6588
- if (getServletContext().getSessionCookieConfig().getName() == null) {
- getServletContext().getSessionCookieConfig().setName("OMSESSIONID");
- }
hazelcast.getCluster().getLocalMember().setStringAttribute(NAME_ATTR_KEY, hazelcast.getName());
hazelWsTopic = hazelcast.getTopic("default");
hazelWsTopic.addMessageListener(msg -> {
- String serverId = msg.getPublishingMember().getStringAttribute(NAME_ATTR_KEY);
- if (serverId.equals(hazelcast.getName())) {
- return;
- }
- WbWebSocketHelper.send(msg.getMessageObject());
- });
+ String serverId = msg.getPublishingMember().getStringAttribute(NAME_ATTR_KEY);
+ if (serverId.equals(hazelcast.getName())) {
+ return;
+ }
+ WbWebSocketHelper.send(msg.getMessageObject());
+ });
hazelcast.getCluster().addMembershipListener(new MembershipListener() {
@Override
public void memberRemoved(MembershipEvent evt) {
@@ -539,9 +535,9 @@ public class Application extends AuthenticatedWebApplication implements IApplica
delim = "";
}
return String.format("%s://%s%s%s;"
- , insecure ? "ws" : "wss"
- , reqUrl.getHost()
- , delim
- , port);
+ , insecure ? "ws" : "wss"
+ , reqUrl.getHost()
+ , delim
+ , port);
}
}