Hardening suggestions for Stirling-PDF / filePath (#2606)

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>
This commit is contained in:
pixeebot[bot] 2025-01-04 00:38:41 +00:00 committed by GitHub
parent d7a3708a13
commit 1e0121b4d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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
}