Skip to content

Commit

Permalink
HPCC-32699 Encode all ALA response data
Browse files Browse the repository at this point in the history
- Encodes all response log data from ALA

Signed-off-by: Rodrigo Pastrana <rodrigo.pastrana@lexisnexisrisk.com>
  • Loading branch information
rpastrana committed Sep 20, 2024
1 parent d23810d commit ba5a269
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,10 @@ unsigned AzureLogAnalyticsCurlClient::processHitsJsonResp(IPropertyTreeIterator
ForEach(*fields)
{
const char * fieldName = header.item(idx++);
returnbuf.appendf("<%s>%s</%s>", fieldName, fields->query().queryProp("."), fieldName);
StringBuffer encodedValue;
encodeXML(fields->query().queryProp("."), encodedValue);

returnbuf.appendf("<%s>%s</%s>", fieldName, encodedValue.str(), fieldName);
}
returnbuf.append("</line>");
recsProcessed++;
Expand Down Expand Up @@ -976,7 +979,10 @@ unsigned AzureLogAnalyticsCurlClient::processHitsJsonResp(IPropertyTreeIterator
if (!firstField)
hitchildjson.append(", ");

hitchildjson.appendf("\"%s\":\"%s\"", header.item(idx++), fields->query().queryProp("."));
StringBuffer encodedValue;
encodeJSON(encodedValue, fields->query().queryProp("."));

hitchildjson.appendf("\"%s\":\"%s\"", header.item(idx++), encodedValue.str());

firstField = false;
}
Expand Down Expand Up @@ -1020,7 +1026,7 @@ unsigned AzureLogAnalyticsCurlClient::processHitsJsonResp(IPropertyTreeIterator
else
first = false;

fieldElementsItr->query().getProp(nullptr, returnbuf); // commas in data should be escaped
encodeCSVColumn(returnbuf, fieldElementsItr->query().queryProp("."));
}
returnbuf.newline();
recsProcessed++;
Expand Down

0 comments on commit ba5a269

Please sign in to comment.