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


##########
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:
   How does the accepted_formats correlate if the payload is raw? Could you add 
a comment for this, I don't think it's trivial.



##########
extensions/http-curl/protocols/RESTSender.cpp:
##########
@@ -162,7 +163,9 @@ C2Payload RESTSender::sendPayload(const std::string& url, 
const Direction direct
   if (payload.getOperation() == Operation::TRANSFER) {
     auto read = 
std::make_unique<utils::HTTPReadCallback>(std::numeric_limits<size_t>::max());
     client.setReadCallback(std::move(read));
-    client.setRequestHeader("Accept", 
"application/vnd.minifi-c2+json;version=1, text/yml");
+    if (accepted_formats) {

Review Comment:
   I think we should also check if this vector is empty, I'm not sure how empty 
accept header would be interpreted.



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