Avoid double encoding URI in ServletServerHttpRequest

Issue: SPR-13876
This commit is contained in:
Sammy Chu
2016-01-19 12:53:22 +08:00
committed by Rossen Stoyanchev
parent a5f4aa6824
commit 5185953f29
4 changed files with 21 additions and 13 deletions

View File

@@ -20,7 +20,6 @@ import java.sql.Date;
import org.junit.Before;
import org.junit.Test;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.web.socket.AbstractHttpRequestTests;
import org.springframework.web.socket.WebSocketHandler;
@@ -31,6 +30,7 @@ import org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSes
import org.springframework.web.socket.sockjs.transport.session.PollingSockJsSession;
import org.springframework.web.socket.sockjs.transport.session.StreamingSockJsSession;
import org.springframework.web.socket.sockjs.transport.session.StubSockJsServiceConfig;
import org.springframework.web.util.UriUtils;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -114,7 +114,8 @@ public class HttpSendingTransportHandlerTests extends AbstractHttpRequestTests
setRequest("POST", "/");
if (callbackValue != null) {
this.servletRequest.setQueryString("c=" + callbackValue);
// need to encode the query parameter
this.servletRequest.setQueryString("c=" + UriUtils.encodeQueryParam(callbackValue, "UTF-8"));
this.servletRequest.addParameter("c", callbackValue);
}