Enable cookie_needed by default in SockJS service
Issue: SPR-10939
This commit is contained in:
@@ -149,7 +149,7 @@ public class AbstractSockJsServiceTests extends AbstractHttpRequestTests {
|
||||
assertEquals(",\"origins\":[\"*:*\"],\"cookie_needed\":false,\"websocket\":true}",
|
||||
body.substring(body.indexOf(',')));
|
||||
|
||||
this.service.setDummySessionCookieEnabled(false);
|
||||
this.service.setSessionCookieNeeded(false);
|
||||
this.service.setWebSocketsEnabled(false);
|
||||
handleRequest("GET", "/a/info", HttpStatus.OK);
|
||||
|
||||
|
||||
@@ -151,40 +151,6 @@ public class DefaultSockJsServiceTests extends AbstractHttpRequestTests {
|
||||
assertEquals("OPTIONS, POST", this.response.getHeaders().getFirst("Access-Control-Allow-Methods"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void dummySessionCookieEnabled() throws Exception {
|
||||
|
||||
setRequest("POST", sessionUrlPrefix + "xhr");
|
||||
this.service.setDummySessionCookieEnabled(true);
|
||||
this.service.handleRequest(this.request, this.response, this.wsHandler);
|
||||
this.response.flush();
|
||||
|
||||
assertEquals(200, this.servletResponse.getStatus());
|
||||
assertEquals("JSESSIONID=dummy;path=/", this.servletResponse.getHeader("Set-Cookie"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void dummySessionCookieDisabled() throws Exception {
|
||||
|
||||
setRequest("POST", sessionUrlPrefix + "xhr");
|
||||
this.service.setDummySessionCookieEnabled(false);
|
||||
this.service.handleTransportRequest(this.request, this.response, this.wsHandler, sessionId, "xhr");
|
||||
|
||||
assertEquals(200, this.servletResponse.getStatus());
|
||||
assertNull(this.servletResponse.getHeader("Set-Cookie"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void dummySessionCookieReuseRequestCookieValue() throws Exception {
|
||||
|
||||
setRequest("POST", sessionUrlPrefix + "xhr");
|
||||
this.servletRequest.addHeader("Cookie", "JSESSIONID=123456789");
|
||||
this.service.handleTransportRequest(this.request, this.response, this.wsHandler, sessionId, "xhr");
|
||||
|
||||
assertEquals(200, this.servletResponse.getStatus());
|
||||
assertNull(this.servletResponse.getHeader("Set-Cookie"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void handleTransportRequestNoSuitableHandler() throws Exception {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user