Merge pull request #798 from Stirling-Tools/pixeebot/fixes

Hardening suggestions for Stirling-PDF / fixes
This commit is contained in:
Anthony Stirling 2024-02-10 00:33:33 +00:00 committed by GitHub
commit fd8f3ce019
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -75,7 +75,7 @@ public class ShowJavascript {
return WebResponseUtils.bytesToWebResponse( return WebResponseUtils.bytesToWebResponse(
script.getBytes(StandardCharsets.UTF_8), script.getBytes(StandardCharsets.UTF_8),
inputFile.getOriginalFilename() + ".js"); Filenames.toSimpleFileName(inputFile.getOriginalFilename()) + ".js");
} }
} }
} }

View file

@ -54,7 +54,7 @@ public class FileToPdf {
if (request.getZoom() != 1.0) { if (request.getZoom() != 1.0) {
// Create a temporary CSS file // Create a temporary CSS file
File tempCssFile = File.createTempFile("customStyle", ".css"); File tempCssFile = Files.createTempFile("customStyle", ".css").toFile();
try (FileWriter writer = new FileWriter(tempCssFile)) { try (FileWriter writer = new FileWriter(tempCssFile)) {
// Write the CSS rule to the file // Write the CSS rule to the file
writer.write("body { zoom: " + request.getZoom() + "; }"); writer.write("body { zoom: " + request.getZoom() + "; }");