2023-12-29 20:48:21 +00:00
|
|
|
package stirling.software.SPDF.utils;
|
|
|
|
|
|
|
|
public class RequestUriUtils {
|
|
|
|
|
2023-12-31 13:34:35 +00:00
|
|
|
public static boolean isStaticResource(String requestURI) {
|
|
|
|
|
|
|
|
return requestURI.startsWith("/css/")
|
2024-05-25 18:19:03 +02:00
|
|
|
|| requestURI.startsWith("/fonts/")
|
2023-12-31 13:34:35 +00:00
|
|
|
|| requestURI.startsWith("/js/")
|
|
|
|
|| requestURI.startsWith("/images/")
|
|
|
|
|| requestURI.startsWith("/public/")
|
|
|
|
|| requestURI.startsWith("/pdfjs/")
|
2024-06-12 21:33:25 +02:00
|
|
|
|| requestURI.startsWith("/pdfjs-legacy/")
|
2023-12-31 13:34:35 +00:00
|
|
|
|| requestURI.endsWith(".svg")
|
2024-06-12 21:36:18 +02:00
|
|
|
|| requestURI.endsWith(".webmanifest")
|
2023-12-31 13:34:35 +00:00
|
|
|
|| requestURI.startsWith("/api/v1/info/status");
|
2023-12-30 19:11:27 +00:00
|
|
|
}
|
2024-06-12 21:36:18 +02:00
|
|
|
|
|
|
|
public static boolean isStaticResource(String contextPath, String requestURI) {
|
|
|
|
|
|
|
|
return requestURI.startsWith(contextPath + "/css/")
|
|
|
|
|| requestURI.startsWith(contextPath + "/fonts/")
|
|
|
|
|| requestURI.startsWith(contextPath + "/js/")
|
|
|
|
|| requestURI.startsWith(contextPath + "/images/")
|
|
|
|
|| requestURI.startsWith(contextPath + "/public/")
|
|
|
|
|| requestURI.startsWith(contextPath + "/pdfjs/")
|
|
|
|
|| requestURI.endsWith(".svg")
|
|
|
|
|| requestURI.endsWith(".webmanifest")
|
|
|
|
|| requestURI.startsWith(contextPath + "/api/v1/info/status");
|
|
|
|
}
|
2023-12-29 20:48:21 +00:00
|
|
|
}
|