exceptionfactory commented on a change in pull request #4892:
URL: https://github.com/apache/nifi/pull/4892#discussion_r593397403



##########
File path: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/InvokeHTTP.java
##########
@@ -1132,31 +1097,25 @@ public long contentLength() {
         } else if (sendBody) {
             return requestBody;
         }
-        return RequestBody.create(null, new byte[0]);
+        return RequestBody.create(new byte[0], null);
     }
 
-    private Request.Builder setHeaderProperties(final ProcessContext context, 
Request.Builder requestBuilder, final FlowFile requestFlowFile) {
+    private void setHeaderProperties(final ProcessContext context, final 
Request.Builder requestBuilder, final FlowFile requestFlowFile) {
         // check if we should send the a Date header with the request
         if (context.getProperty(PROP_DATE_HEADER).asBoolean()) {
-            requestBuilder = requestBuilder.addHeader("Date", 
DATE_FORMAT.print(System.currentTimeMillis()));
+            final ZonedDateTime universalCoordinatedTimeNow = 
ZonedDateTime.now(ZoneOffset.UTC);
+            requestBuilder.addHeader("Date", 
RFC_2616_DATE_TIME.format(universalCoordinatedTimeNow));
         }
 
-        final ComponentLog logger = getLogger();
         for (String headerKey : dynamicPropertyNames) {
             String headerValue = 
context.getProperty(headerKey).evaluateAttributeExpressions(requestFlowFile).getValue();
 
-            // don't include any of the excluded headers, log instead
-            if (excludedHeaders.containsKey(headerKey)) {
-                logger.warn(excludedHeaders.get(headerKey), new 
Object[]{headerKey});
-                continue;
-            }
-

Review comment:
       This goes along with the comment regarding `Trusted Hostname`.  The log 
message does not contain much useful details, and as any use of the custom 
`Trusted Hostname` header depends on the handling of the receiving HTTP server, 
I recommend removing this block.




----------------------------------------------------------------
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]


Reply via email to