alopresto commented on a change in pull request #4125: NIFI-7153 Adds
ContentLengthFilter and DoSFilter
URL: https://github.com/apache/nifi/pull/4125#discussion_r390685093
##########
File path:
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java
##########
@@ -607,6 +612,25 @@ private WebAppContext loadWar(final File warFile, final
String contextPath, fina
return webappContext;
}
+ private void addContentLengthFilter(String contextPath, String pathSpec,
WebAppContext webappContext) {
+ final FilterHolder holder = new
FilterHolder(ContentLengthFilter.class);
+ final Map<String, String> largePaths =
props.getWebMaxContentSizeLargePaths();
+ int size;
+
+ if (!largePaths.containsValue(contextPath)) {
+ size = DataUnit.parseDataSize(props.getWebMaxContentSize(),
DataUnit.B).intValue();
Review comment:
What happens if the max content size is not parseable as a data unit? In the
unit tests, these properties accepted "size value" and "large size value"
without complaint, so I don't believe there's any internal validation
occurring.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services