From 1e0121b4d601a06f79f900a5146d49c49c13f886 Mon Sep 17 00:00:00 2001 From: "pixeebot[bot]" <104101892+pixeebot[bot]@users.noreply.github.com> Date: Sat, 4 Jan 2025 00:38:41 +0000 Subject: [PATCH] Hardening suggestions for Stirling-PDF / filePath (#2606) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I've reviewed the recently opened PR ([2605 - File paths dynamic ](https://github.com/Stirling-Tools/Stirling-PDF/pull/2605)) and have identified some area(s) that could benefit from additional hardening measures. These changes should help prevent potential security vulnerabilities and improve overall code quality. Thank you for your consideration! 🧚🤖 Powered by Pixeebot [Feedback](https://ask.pixee.ai/feedback) | [Community](https://pixee-community.slack.com/signup#/domain-signup) | [Docs](https://docs.pixee.ai/) ![](https://d1zaessa2hpsmj.cloudfront.net/pixel/v1/track?writeKey=2PI43jNm7atYvAuK7rJUz3Kcd6A&event=PR_HARDENING%7CStirling-Tools%2FStirling-PDF%7C73ac17942fc6504dd1d4e9a8c779e26aba813ac9) Co-authored-by: pixeebot[bot] <104101892+pixeebot[bot]@users.noreply.github.com> --- src/main/java/stirling/software/SPDF/utils/GeneralUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/stirling/software/SPDF/utils/GeneralUtils.java b/src/main/java/stirling/software/SPDF/utils/GeneralUtils.java index 13d19145..53c845ed 100644 --- a/src/main/java/stirling/software/SPDF/utils/GeneralUtils.java +++ b/src/main/java/stirling/software/SPDF/utils/GeneralUtils.java @@ -86,7 +86,7 @@ public class GeneralUtils { // Allow only http and https protocols String protocol = url.getProtocol(); - if (!protocol.equals("http") && !protocol.equals("https")) { + if (!"http".equals(protocol) && !"https".equals(protocol)) { return false; // Disallow other protocols }