From 584b7081327ea4f08b0a5797184a2ebec0683207 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Wed, 29 Sep 2021 10:54:24 -0500 Subject: [PATCH] fixup! Revise legacy response to work with #470 --- src/deprecated.jl | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/deprecated.jl b/src/deprecated.jl index 466fd1867..8f8b56a87 100644 --- a/src/deprecated.jl +++ b/src/deprecated.jl @@ -96,7 +96,7 @@ function legacy_response( end end - body = String(copy(body)) + body_str = String(copy(body)) if occursin(r"/xml", mime) if return_headers @@ -118,8 +118,8 @@ function legacy_response( end xml_dict_type = response_dict_type{Union{Symbol,String},Any} - body = parse_xml(body) - root = XMLDict.root(body.x) + xml = parse_xml(body_str) + root = XMLDict.root(xml.x) return ( if return_headers @@ -147,8 +147,7 @@ function legacy_response( ) end - info = - isempty(body) ? nothing : JSON.parse(body; dicttype=response_dict_type) + info = isempty(body) ? nothing : JSON.parse(body_str; dicttype=response_dict_type) return (return_headers ? (info, response_dict_type(response.headers)) : info) elseif startswith(mime, "text/") if return_headers @@ -169,7 +168,9 @@ function legacy_response( ) end - return (return_headers ? (body, response_dict_type(response.headers)) : body) + return ( + return_headers ? (body_str, response_dict_type(response.headers)) : body_str + ) else if return_headers Base.depwarn(