From 7bdefb69c23ea11b024c8ef5d747f22eb5920fc5 Mon Sep 17 00:00:00 2001
From: Muratcan Yeldan <48444068+muratcanyeldan@users.noreply.github.com>
Date: Thu, 17 Apr 2025 13:23:08 +0300
Subject: [PATCH 1/4] Make file extension checks case-insensitive in pipeline
(#3368)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
# Description of Changes
File extensions in the pipeline were being checked in a case-sensitive
manner. Since supported extensions were defined in lowercase only, files
with uppercase extensions were being rejected directly, and logs like
the following were being printed:
With this change, the uploaded file’s extension is now converted to
lowercase using toLowerCase, making the extension check
case-insensitive. After this change, the logs flow as expected, as shown
below:
Closes #3243
---
## Checklist
### General
- [X] I have read the [Contribution
Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md)
- [X] I have read the [Stirling-PDF Developer
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md)
(if applicable)
- [X] I have read the [How to add new languages to
Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md)
(if applicable)
- [X] I have performed a self-review of my own code
- [X] My changes generate no new warnings
### Documentation
- [ ] I have updated relevant docs on [Stirling-PDF's doc
repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/)
(if functionality has heavily changed)
- [ ] I have read the section [Add New Translation
Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags)
(for new translation tags only)
### UI Changes (if applicable)
- [ ] Screenshots or videos demonstrating the UI changes are attached
(e.g., as comments or direct attachments in the PR)
### Testing (if applicable)
- [X] I have tested my changes locally. Refer to the [Testing
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing)
for more details.
---
.../api/pipeline/PipelineDirectoryProcessor.java | 3 ++-
.../SPDF/controller/api/pipeline/PipelineProcessor.java | 7 +++++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/main/java/stirling/software/SPDF/controller/api/pipeline/PipelineDirectoryProcessor.java b/src/main/java/stirling/software/SPDF/controller/api/pipeline/PipelineDirectoryProcessor.java
index a9e1f4103..96a65fc46 100644
--- a/src/main/java/stirling/software/SPDF/controller/api/pipeline/PipelineDirectoryProcessor.java
+++ b/src/main/java/stirling/software/SPDF/controller/api/pipeline/PipelineDirectoryProcessor.java
@@ -208,7 +208,8 @@ public class PipelineDirectoryProcessor {
// Check against allowed extensions
boolean isAllowed =
allowAllFiles
- || inputExtensions.contains(extension);
+ || inputExtensions.contains(
+ extension.toLowerCase());
if (!isAllowed) {
log.info(
"Skipping file with unsupported extension: {} ({})",
diff --git a/src/main/java/stirling/software/SPDF/controller/api/pipeline/PipelineProcessor.java b/src/main/java/stirling/software/SPDF/controller/api/pipeline/PipelineProcessor.java
index c3d212115..2833ee99e 100644
--- a/src/main/java/stirling/software/SPDF/controller/api/pipeline/PipelineProcessor.java
+++ b/src/main/java/stirling/software/SPDF/controller/api/pipeline/PipelineProcessor.java
@@ -112,7 +112,8 @@ public class PipelineProcessor {
for (Resource file : outputFiles) {
boolean hasInputFileType = false;
for (String extension : inputFileTypes) {
- if ("ALL".equals(extension) || file.getFilename().endsWith(extension)) {
+ if ("ALL".equals(extension)
+ || file.getFilename().toLowerCase().endsWith(extension)) {
hasInputFileType = true;
MultiValueMap body = new LinkedMultiValueMap<>();
body.add("fileInput", file);
@@ -166,7 +167,9 @@ public class PipelineProcessor {
.filter(
file ->
finalinputFileTypes.stream()
- .anyMatch(file.getFilename()::endsWith))
+ .anyMatch(
+ file.getFilename().toLowerCase()
+ ::endsWith))
.toList();
}
// Check if there are matching files
From ef6c0f238335cb7347d9fa494ccd6e953618659b Mon Sep 17 00:00:00 2001
From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com>
Date: Thu, 17 Apr 2025 18:52:03 +0100
Subject: [PATCH 2/4] fix security deploy (#3373)
# Description of Changes
Please provide a summary of the changes, including:
- What was changed
- Why the change was made
- Any challenges encountered
Closes #(issue_number)
---
## Checklist
### General
- [ ] I have read the [Contribution
Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md)
- [ ] I have read the [Stirling-PDF Developer
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md)
(if applicable)
- [ ] I have read the [How to add new languages to
Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md)
(if applicable)
- [ ] I have performed a self-review of my own code
- [ ] My changes generate no new warnings
### Documentation
- [ ] I have updated relevant docs on [Stirling-PDF's doc
repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/)
(if functionality has heavily changed)
- [ ] I have read the section [Add New Translation
Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags)
(for new translation tags only)
### UI Changes (if applicable)
- [ ] Screenshots or videos demonstrating the UI changes are attached
(e.g., as comments or direct attachments in the PR)
### Testing (if applicable)
- [ ] I have tested my changes locally. Refer to the [Testing
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing)
for more details.
---
.github/workflows/PR-Demo-Comment-with-react.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/PR-Demo-Comment-with-react.yml b/.github/workflows/PR-Demo-Comment-with-react.yml
index fb196ca3a..105fb60b1 100644
--- a/.github/workflows/PR-Demo-Comment-with-react.yml
+++ b/.github/workflows/PR-Demo-Comment-with-react.yml
@@ -186,7 +186,7 @@ jobs:
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/test:pr-${{ needs.check-comment.outputs.pr_number }}
- build-args: VERSION_TAG=${{ steps.versionNumber.outputs.versionNumber }}
+ build-args: VERSION_TAG=alpha
platforms: linux/amd64
- name: Set up SSH
From 54f2e012f5f81ec6e21b25c7f8343e31c284dc7c Mon Sep 17 00:00:00 2001
From: Ludy
Date: Thu, 17 Apr 2025 21:10:39 +0000
Subject: [PATCH 3/4] Bump ruff to v0.11.6 and gitleaks to v8.24.3 in
pre-commit config (#3376)
# Description of Changes
Please provide a summary of the changes, including:
- **What was changed**
Updated the versions of two pre-commit hooks in
`.pre-commit-config.yaml`:
- `ruff` from `v0.9.10` to `v0.11.6`
- `gitleaks` from `v8.24.0` to `v8.24.3`
- **Why the change was made**
Keeping linting and security-scanning tools up to date ensures we
benefit from the latest bug fixes, performance improvements, and new
checks. This helps maintain code quality and reduces the risk of false
positives or unfixed vulnerabilities.
---
## Checklist
### General
- [x] I have read the [Contribution
Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md)
- [x] I have read the [Stirling-PDF Developer
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md)
(if applicable)
- [ ] I have read the [How to add new languages to
Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md)
(if applicable)
- [x] I have performed a self-review of my own code
- [x] My changes generate no new warnings
### Documentation
- [ ] I have updated relevant docs on [Stirling-PDF's doc
repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/)
(if functionality has heavily changed)
- [ ] I have read the section [Add New Translation
Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags)
(for new translation tags only)
### UI Changes (if applicable)
- [ ] Screenshots or videos demonstrating the UI changes are attached
(e.g., as comments or direct attachments in the PR)
### Testing (if applicable)
- [ ] I have tested my changes locally. Refer to the [Testing
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing)
for more details.
---
.pre-commit-config.yaml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index fc27b0731..c792e50a0 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
- rev: v0.9.10
+ rev: v0.11.6
hooks:
- id: ruff
args:
@@ -22,7 +22,7 @@ repos:
files: \.(html|css|js|py|md)$
exclude: (.vscode|.devcontainer|src/main/resources|Dockerfile|.*/pdfjs.*|.*/thirdParty.*|bootstrap.*|.*\.min\..*|.*diff\.js)
- repo: https://github.com/gitleaks/gitleaks
- rev: v8.24.0
+ rev: v8.24.3
hooks:
- id: gitleaks
- repo: https://github.com/pre-commit/pre-commit-hooks
From c388ba73c12372251d96d94341f5e319183ccf55 Mon Sep 17 00:00:00 2001
From: Ludy
Date: Thu, 17 Apr 2025 21:11:30 +0000
Subject: [PATCH 4/4] Update Google Java Format to v1.26.0 across devcontainer,
VSCode, and Gradle configuration (#3375)
# Description of Changes
Please provide a summary of the changes, including:
- **What was changed**
Updated `java.format.settings.google.version` from `1.25.2` to `1.26.0`
in:
- `.devcontainer/devcontainer.json`
- `.vscode/settings.json`
- `build.gradle` (Spotless plugin configuration)
- **Why the change was made**
Bump to the latest Google Java Format release (v1.26.0) to pick up
formatting improvements, bug fixes, and maintain consistency across all
development environments.
---
## Checklist
### General
- [x] I have read the [Contribution
Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md)
- [x] I have read the [Stirling-PDF Developer
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md)
(if applicable)
- [ ] I have read the [How to add new languages to
Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md)
(if applicable)
- [x] I have performed a self-review of my own code
- [x] My changes generate no new warnings
### Documentation
- [ ] I have updated relevant docs on [Stirling-PDF's doc
repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/)
(if functionality has heavily changed)
- [ ] I have read the section [Add New Translation
Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags)
(for new translation tags only)
### UI Changes (if applicable)
- [ ] Screenshots or videos demonstrating the UI changes are attached
(e.g., as comments or direct attachments in the PR)
### Testing (if applicable)
- [ ] I have tested my changes locally. Refer to the [Testing
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing)
for more details.
---
.devcontainer/devcontainer.json | 2 +-
.vscode/settings.json | 2 +-
build.gradle | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index 928b0ec96..644378d12 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -49,7 +49,7 @@
"java.configuration.updateBuildConfiguration": "interactive",
"java.format.enabled": true,
"java.format.settings.profile": "GoogleStyle",
- "java.format.settings.google.version": "1.25.2",
+ "java.format.settings.google.version": "1.26.0",
"java.format.settings.google.extra": "--aosp --skip-sorting-imports --skip-javadoc-formatting",
"java.saveActions.cleanup": true,
"java.cleanup.actions": [
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 2119b6263..a4be4d0cd 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -10,7 +10,7 @@
"java.configuration.updateBuildConfiguration": "interactive",
"java.format.enabled": true,
"java.format.settings.profile": "GoogleStyle",
- "java.format.settings.google.version": "1.25.2",
+ "java.format.settings.google.version": "1.26.0",
"java.format.settings.google.extra": "--aosp --skip-sorting-imports --skip-javadoc-formatting",
// (DE) Aktiviert Kommentare im Java-Format.
// (EN) Enables comments in Java formatting.
diff --git a/build.gradle b/build.gradle
index b49b03c01..3f3219af4 100644
--- a/build.gradle
+++ b/build.gradle
@@ -365,7 +365,7 @@ spotless {
java {
target project.fileTree('src').include('**/*.java')
- googleJavaFormat("1.25.2").aosp().reorderImports(false)
+ googleJavaFormat("1.26.0").aosp().reorderImports(false)
importOrder("java", "javax", "org", "com", "net", "io", "jakarta", "lombok", "me", "stirling")
toggleOffOn()