Hardening suggestions for Stirling-PDF / settings (#4042)

I've reviewed the recently opened PR ([4015 - V2 settings api (Added to
V1)](https://github.com/Stirling-Tools/Stirling-PDF/pull/4015)) 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%7C1d1522bd7a9e9eff4cbadcf868304f8c14a130b4)

Co-authored-by: pixeebot[bot] <104101892+pixeebot[bot]@users.noreply.github.com>
This commit is contained in:
pixeebot[bot] 2025-07-28 23:10:12 +01:00 committed by GitHub
parent a0445cebfe
commit 97c7a0543c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -557,7 +557,7 @@ public class AdminSettingsController {
String lowerPath = fullPath.toLowerCase();
// Don't mask premium.key specifically
if (lowerField.equals("key") && lowerPath.equals("premium.key")) {
if ("key".equals(lowerField) && "premium.key".equals(lowerPath)) {
return false;
}