Github user mcgilman commented on a diff in the pull request:
https://github.com/apache/nifi/pull/175#discussion_r50262265
--- Diff:
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PostHTTP.java
---
@@ -534,12 +536,7 @@ public void process(final HttpResponse response, final
HttpContext httpContext)
destinationAccepts = config.getDestinationAccepts();
if (destinationAccepts == null) {
try {
- if (sendAsFlowFile) {
- destinationAccepts =
getDestinationAcceptance(client, url, getLogger(), transactionId);
- } else {
- destinationAccepts = new
DestinationAccepts(false, false, false, false, null);
--- End diff --
In the previous version of PostHTTP, the acceptsFlowFileV[1,2,3] are false
and the protocol is null when sendAsFlowFIle is set to false. In the current
version, the values will be based on the response from the HEAD request.
1) If that response happens to return NOT_ALLOWED, it is assumed to be V1.
I don't think this assumption is valid anymore.
2) If that response happens to return OK, the values will be based on the
response. However, it looks like there are assumptions which could set the
FlowFile version and protocol incorrectly.
I followed these paths through and I don't think there are any issues as
the Processor only considers these fields when sendAsFlowFile is true. However,
having the fields set incorrectly could be potentially error prone in the
future as the assumptions stated are no longer true.
I think to address this we simply need to consider sendAsFlowFile when
deciding the value of acceptsFlowFileV[1,2,3] and protocol. These fields should
only be set/initialized when sendAsFlowFile is true.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---