adamdebreceni commented on code in PR #1522:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1522#discussion_r1124373053


##########
extensions/http-curl/protocols/RESTSender.cpp:
##########
@@ -181,7 +184,7 @@ C2Payload RESTSender::sendPayload(const std::string& url, 
const Direction direct
   const auto response_body_bytes = 
gsl::make_span(client.getResponseBody()).as_span<const std::byte>();
   logger_->log_trace("Received response: \"%s\"", [&] {return 
utils::StringUtils::escapeUnprintableBytes(response_body_bytes);});
   if (isOkay && !clientError && !serverError) {
-    if (payload.isRaw()) {
+    if (accepted_formats) {

Review Comment:
    as I understand the direct download feature (e.g. a GET to the flow url) is 
outside the scope of the c2 protocol, even though it was done through the 
`consumePayload` method, the newly added `fetch` allows us to be explicit about 
this, implementation-wise the `RESTSender` uses its `sendPayload` for both 
except if the `accepted_formats` is set (not `nullopt`) we do not try to parse 
the response as JSON expecting a command, but forward the response as-is



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to