Skip to content

Conversation

DarioGii
Copy link
Contributor

@DarioGii DarioGii commented Sep 8, 2025

Defaulting the configuration settings for Stirling PDF's JWT to false to avoid any unexpected issues

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines ignoring generated files. label Sep 8, 2025
@stirlingbot stirlingbot bot added the Back End Issues related to back-end development label Sep 8, 2025
Frooodle
Frooodle previously approved these changes Sep 8, 2025
ConnorYoh
ConnorYoh previously approved these changes Sep 8, 2025
jbrunton96
jbrunton96 previously approved these changes Sep 8, 2025
@DarioGii DarioGii dismissed stale reviews from jbrunton96, ConnorYoh, and Frooodle via 9d535ed September 8, 2025 10:58
@dosubot dosubot bot added size:M This PR changes 30-99 lines ignoring generated files. and removed size:XS This PR changes 0-9 lines ignoring generated files. labels Sep 8, 2025
@stirlingbot stirlingbot bot added Java Pull requests that update Java code Security Security-related issues or pull requests API API-related issues or pull requests labels Sep 8, 2025
@dosubot dosubot bot added size:L This PR changes 100-499 lines ignoring generated files. and removed size:M This PR changes 30-99 lines ignoring generated files. labels Sep 8, 2025
@@ -379,7 +379,7 @@ public static class TempFileManagement {
public String getBaseTmpDir() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better if

        @JsonIgnore
        public String getBaseTmpDir() {
            if (baseTmpDir != null && !baseTmpDir.isEmpty()) {
                return baseTmpDir;
            }
            String tmp = java.lang.System.getProperty("java.io.tmpdir");
            return new File(tmp, "stirling-pdf").getPath();
        }

        @JsonIgnore
        public String getLibreofficeDir() {
            if (libreofficeDir != null && !libreofficeDir.isEmpty()) {
                return libreofficeDir;
            }
            return new File(getBaseTmpDir(), "libreoffice").getPath();
        }

This would eliminate problems with Windows (\) and Linux (/)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String expectedBase =
java.lang.System.getProperty("java.io.tmpdir").replaceAll("/+$", "")
+ "/stirling-pdf";
assertEquals(expectedBase, tfm.getBaseTmpDir());
String expectedLibre = expectedBase + "/libreoffice";
assertEquals(expectedLibre, tfm.getLibreofficeDir());

chnage to

        String expectedBase =
                Paths.get(java.lang.System.getProperty("java.io.tmpdir"), "stirling-pdf").toString();
        assertEquals(expectedBase, tfm.getBaseTmpDir());

        String expectedLibre = Paths.get(expectedBase, "libreoffice").toString();
        assertEquals(expectedLibre, tfm.getLibreofficeDir());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API API-related issues or pull requests Back End Issues related to back-end development Java Pull requests that update Java code Security Security-related issues or pull requests size:L This PR changes 100-499 lines ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants