|
67 | 67 | * non matching request paths are redirected, or an error code is returned, |
68 | 68 | * according to the setup of redirectPath and errorCode |
69 | 69 | * - redirectPath: if the path requested is not in the allowedPaths, or forceRedirectAll is set to Y, |
70 | | - * specifies the the path to which the request is redirected to; |
| 70 | + * specifies the path to which the request is redirected to; |
71 | 71 | * - errorCode: the error code set in the response if the path requested is not in the allowedPaths |
72 | 72 | * and redirectPath is not set; defaults to 403 |
73 | 73 | * |
@@ -140,10 +140,6 @@ private static Set<String> readAllowedPaths(String paths) { |
140 | 140 | : Arrays.stream(paths.split(":")).collect(Collectors.toSet()); |
141 | 141 | } |
142 | 142 |
|
143 | | - private static boolean isSolrTest() { |
144 | | - return null != System.getProperty("SolrDispatchFilter"); |
145 | | - } |
146 | | - |
147 | 143 | /** |
148 | 144 | * Sends an HTTP response redirecting to {@code redirectPath}. |
149 | 145 | * @param resp The response to send |
@@ -176,7 +172,7 @@ public void doFilter(HttpServletRequest req, HttpServletResponse resp, FilterCha |
176 | 172 | boolean isEntityImport = req.getRequestURI().equals("/webtools/control/entityImport"); |
177 | 173 | boolean isProgramExport = req.getRequestURI().equals("/webtools/control/ProgramExport"); |
178 | 174 |
|
179 | | - if (!(isSolrTest() || isControlFilterTests() || isEntityImport || isProgramExport)) { |
| 175 | + if (!(isControlFilterTests() || isEntityImport || isProgramExport)) { |
180 | 176 | // Prevents stream exploitation |
181 | 177 | UrlServletHelper.setRequestAttributes(req, null, req.getServletContext()); |
182 | 178 | Map<String, Object> parameters = UtilHttp.getParameterMap(req); |
@@ -227,10 +223,10 @@ public void doFilter(HttpServletRequest req, HttpServletResponse resp, FilterCha |
227 | 223 |
|
228 | 224 | //// Block with several steps for rejecting wrong URLs, allowing specific ones |
229 | 225 |
|
230 | | - // Allows UEL and FlexibleString (OFBIZ-12602). Also allows SolrTest to pass. No need to check these URLs |
| 226 | + // Allows UEL and FlexibleString (OFBIZ-12602). |
231 | 227 | GenericValue userLogin = (GenericValue) session.getAttribute("userLogin"); |
232 | 228 | if (!LoginWorker.hasBasePermission(userLogin, req)) { // Allows UEL and FlexibleString (OFBIZ-12602) |
233 | | - if (isSolrTest() && SecuredFreemarker.containsFreemarkerInterpolation(req, resp, uri)) { // Reject Freemarker interpolation in URL |
| 229 | + if (SecuredFreemarker.containsFreemarkerInterpolation(req, resp, uri)) { // Reject Freemarker interpolation in URL |
234 | 230 | return; |
235 | 231 | } |
236 | 232 | } |
|
0 commit comments