提交 a86283eb 编写于 作者: R Rossen Stoyanchev

Make removal of jsessionid case insensitive

Issue: SPR-10398
上级 d23de282
......@@ -457,7 +457,7 @@ public class UrlPathHelper {
}
private String removeJsessionid(String requestUri) {
int startIndex = requestUri.indexOf(";jsessionid=");
int startIndex = requestUri.toLowerCase().indexOf(";jsessionid=");
if (startIndex != -1) {
int endIndex = requestUri.indexOf(';', startIndex + 12);
String start = requestUri.substring(0, startIndex);
......
......@@ -16,9 +16,6 @@
package org.springframework.web.util;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import java.io.UnsupportedEncodingException;
import org.junit.Before;
......@@ -26,6 +23,8 @@ import org.junit.Ignore;
import org.junit.Test;
import org.springframework.mock.web.test.MockHttpServletRequest;
import static org.junit.Assert.*;
/**
* @author Rob Harrop
* @author Juergen Hoeller
......@@ -111,6 +110,11 @@ public class UrlPathHelperTests {
request.setRequestURI("/foo;a=b;jsessionid=c0o7fszeb1;c=d");
assertEquals("jsessionid should always be removed", "/foo;a=b;c=d", helper.getRequestUri(request));
// SPR-10398
request.setRequestURI("/foo;a=b;JSESSIONID=c0o7fszeb1;c=d");
assertEquals("JSESSIONID should always be removed", "/foo;a=b;c=d", helper.getRequestUri(request));
}
@Test
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册