You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "pvillard31 (via GitHub)" <gi...@apache.org> on 2026/08/18 11:19:56 UTC
[PR] NIFI-16220 - Improve downloaded file handling in NiFi client modules [nifi]
pvillard31 opened a new pull request, #11560:
URL: https://github.com/apache/nifi/pull/11560
# Summary
NIFI-16220 - Improve downloaded file handling in NiFi client modules
# Tracking
Please complete the following tracking steps prior to pull request creation.
### Issue Tracking
- [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue created
### Pull Request Tracking
- Pull Request title starts with Apache NiFi Jira issue number, such as `NIFI-00000`
- Pull Request commit message starts with Apache NiFi Jira issue number, as such `NIFI-00000`
- Pull request contains [commits signed](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits) with a registered key indicating `Verified` status
### Pull Request Formatting
- Pull Request based on current revision of the `main` branch
- Pull Request refers to a feature branch with one commit containing changes
# Verification
Please indicate the verification steps performed prior to pull request creation.
### Build
- [ ] Build completed using `./mvnw clean install -P contrib-check`
- [ ] JDK 21
- [ ] JDK 25
### Licensing
- [ ] New dependencies are compatible with the [Apache License 2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License Policy](https://www.apache.org/legal/resolved.html)
- [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` files
### Documentation
- [ ] Documentation formatting appears as expected in rendered files
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-16220 - Improve downloaded file handling in NiFi client modules [nifi]
Posted by "exceptionfactory (via GitHub)" <gi...@apache.org>.
exceptionfactory commented on code in PR #11560:
URL: https://github.com/apache/nifi/pull/11560#discussion_r3810041895
##########
nifi-registry/nifi-registry-core/nifi-registry-client/src/main/java/org/apache/nifi/registry/client/impl/ClientUtils.java:
##########
@@ -44,4 +45,38 @@ public static File getExtensionBundleVersionContent(final Response response, fin
}
}
+ private static File getContentDispositionFile(final String contentDispositionHeader, final File outputDirectory) {
+ if (contentDispositionHeader.indexOf('\\') >= 0) {
Review Comment:
It would be helpful to declare this character and others as static member variables
##########
nifi-toolkit/nifi-toolkit-client/src/main/java/org/apache/nifi/toolkit/client/impl/AbstractJerseyClient.java:
##########
@@ -139,18 +143,41 @@ protected String getContentDispositionFilename(final Response response) {
if (StringUtils.isBlank(contentDispositionHeader)) {
throw new IllegalStateException("Content-Disposition header was blank or missing");
}
+ if (contentDispositionHeader.indexOf('\\') >= 0) {
+ throw new IllegalStateException("Content-Disposition filename was invalid");
+ }
+
+ final String filename;
+ try {
+ final String normalizedHeader = contentDispositionHeader.replaceFirst("(?i);\\s*filename\\s*=\\s*", "; filename=");
Review Comment:
See similar notes regarding regular expression pattern and character variables
##########
nifi-registry/nifi-registry-core/nifi-registry-client/src/main/java/org/apache/nifi/registry/client/impl/ClientUtils.java:
##########
@@ -44,4 +45,38 @@ public static File getExtensionBundleVersionContent(final Response response, fin
}
}
+ private static File getContentDispositionFile(final String contentDispositionHeader, final File outputDirectory) {
+ if (contentDispositionHeader.indexOf('\\') >= 0) {
+ throw new IllegalStateException("Content-Disposition filename was invalid");
+ }
+
+ final String filename;
+ try {
+ final String normalizedHeader = contentDispositionHeader.replaceFirst("(?i);\\s*filename\\s*=\\s*", "; filename=");
Review Comment:
I recommend declaring the regular expression pattern as a static member variable and using matching instead of the String method
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-16220 - Improve downloaded file handling in NiFi client modules [nifi]
Posted by "exceptionfactory (via GitHub)" <gi...@apache.org>.
exceptionfactory merged PR #11560:
URL: https://github.com/apache/nifi/pull/11560
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-16220 - Improve downloaded file handling in NiFi client modules [nifi]
Posted by "pvillard31 (via GitHub)" <gi...@apache.org>.
pvillard31 commented on PR #11560:
URL: https://github.com/apache/nifi/pull/11560#issuecomment-5339566892
Thanks for the review @exceptionfactory - done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org