mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-26 13:53:14 +00:00
Merge branch '5.8.x' into 6.0.x
Closes gh-12671
This commit is contained in:
commit
e7d65966fd
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2022 the original author or authors.
|
* Copyright 2002-2023 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -225,7 +225,8 @@ public class DefaultSavedRequest implements SavedRequest {
|
|||||||
if (!propertyEquals(this.pathInfo, request.getPathInfo())) {
|
if (!propertyEquals(this.pathInfo, request.getPathInfo())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!propertyEquals(this.queryString, request.getQueryString())) {
|
if (!propertyEquals(createQueryString(this.queryString, this.matchingRequestParameterName),
|
||||||
|
request.getQueryString())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!propertyEquals(this.requestURI, request.getRequestURI())) {
|
if (!propertyEquals(this.requestURI, request.getRequestURI())) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2016 the original author or authors.
|
* Copyright 2002-2023 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -114,6 +114,23 @@ public class HttpSessionRequestCacheTests {
|
|||||||
cache.setMatchingRequestParameterName("success");
|
cache.setMatchingRequestParameterName("success");
|
||||||
cache.saveRequest(request, new MockHttpServletResponse());
|
cache.saveRequest(request, new MockHttpServletResponse());
|
||||||
MockHttpServletRequest requestToMatch = new MockHttpServletRequest();
|
MockHttpServletRequest requestToMatch = new MockHttpServletRequest();
|
||||||
|
requestToMatch.setQueryString("success"); // gh-12665
|
||||||
|
requestToMatch.setParameter("success", "");
|
||||||
|
requestToMatch.setSession(request.getSession());
|
||||||
|
HttpServletRequest matchingRequest = cache.getMatchingRequest(requestToMatch, new MockHttpServletResponse());
|
||||||
|
assertThat(matchingRequest).isNotNull();
|
||||||
|
}
|
||||||
|
|
||||||
|
// gh-12665
|
||||||
|
@Test
|
||||||
|
public void getMatchingRequestWhenMatchingRequestParameterNameSetAndParameterExistAndQueryThenLookedUp() {
|
||||||
|
MockHttpServletRequest request = new MockHttpServletRequest();
|
||||||
|
request.setQueryString("param=true");
|
||||||
|
HttpSessionRequestCache cache = new HttpSessionRequestCache();
|
||||||
|
cache.setMatchingRequestParameterName("success");
|
||||||
|
cache.saveRequest(request, new MockHttpServletResponse());
|
||||||
|
MockHttpServletRequest requestToMatch = new MockHttpServletRequest();
|
||||||
|
requestToMatch.setQueryString("param=true&success");
|
||||||
requestToMatch.setParameter("success", "");
|
requestToMatch.setParameter("success", "");
|
||||||
requestToMatch.setSession(request.getSession());
|
requestToMatch.setSession(request.getSession());
|
||||||
HttpServletRequest matchingRequest = cache.getMatchingRequest(requestToMatch, new MockHttpServletResponse());
|
HttpServletRequest matchingRequest = cache.getMatchingRequest(requestToMatch, new MockHttpServletResponse());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user