|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2016 the original author or authors. |
| 2 | + * Copyright 2002-2023 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -115,6 +115,23 @@ public void getMatchingRequestWhenMatchingRequestParameterNameSetAndParameterExi
|
115 | 115 | cache.setMatchingRequestParameterName("success");
|
116 | 116 | cache.saveRequest(request, new MockHttpServletResponse());
|
117 | 117 | MockHttpServletRequest requestToMatch = new MockHttpServletRequest();
|
| 118 | + requestToMatch.setQueryString("success"); // gh-12665 |
| 119 | + requestToMatch.setParameter("success", ""); |
| 120 | + requestToMatch.setSession(request.getSession()); |
| 121 | + HttpServletRequest matchingRequest = cache.getMatchingRequest(requestToMatch, new MockHttpServletResponse()); |
| 122 | + assertThat(matchingRequest).isNotNull(); |
| 123 | + } |
| 124 | + |
| 125 | + // gh-12665 |
| 126 | + @Test |
| 127 | + public void getMatchingRequestWhenMatchingRequestParameterNameSetAndParameterExistAndQueryThenLookedUp() { |
| 128 | + MockHttpServletRequest request = new MockHttpServletRequest(); |
| 129 | + request.setQueryString("param=true"); |
| 130 | + HttpSessionRequestCache cache = new HttpSessionRequestCache(); |
| 131 | + cache.setMatchingRequestParameterName("success"); |
| 132 | + cache.saveRequest(request, new MockHttpServletResponse()); |
| 133 | + MockHttpServletRequest requestToMatch = new MockHttpServletRequest(); |
| 134 | + requestToMatch.setQueryString("param=true&success"); |
118 | 135 | requestToMatch.setParameter("success", "");
|
119 | 136 | requestToMatch.setSession(request.getSession());
|
120 | 137 | HttpServletRequest matchingRequest = cache.getMatchingRequest(requestToMatch, new MockHttpServletResponse());
|
|
0 commit comments