fix rest_xml_no_input integration test

This commit is contained in:
Emil Lerch 2022-05-29 11:16:55 -07:00
parent 08c2ed0c07
commit 03f7228662
Signed by: lobo
GPG Key ID: A7B62D657EF764F8

View File

@ -399,7 +399,9 @@ pub fn Request(comptime action: anytype) type {
const xml_options = xml_shaper.ParseOptions{ .allocator = options.client.allocator };
var body: []const u8 = result.body;
var free_body = false;
if (std.mem.lastIndexOf(u8, result.body[result.body.len - 20 ..], "Response>") == null) {
if (std.mem.lastIndexOf(u8, result.body[result.body.len - 20 ..], "Response>") == null and
std.mem.lastIndexOf(u8, result.body[result.body.len - 20 ..], "Result>") == null)
{
free_body = true;
// chop the "<?xml version="1.0"?>" from the front
const start = if (std.mem.indexOf(u8, result.body, "?>")) |i| i else 0;