From 86f0342ea1ce0805566ae0a123a7890ca261c2b5 Mon Sep 17 00:00:00 2001 From: Danton Noriega Date: Thu, 24 Sep 2020 16:58:53 -0700 Subject: [PATCH] Update s3HTTP.R `ctype == "application/xml"` is way too strict. For s3-like platforms, you can get returns like `"application/xml; utf-8"` and the entire package fails to parse and flatten. It's a small, but incredibly impactful, change. --- R/s3HTTP.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/s3HTTP.R b/R/s3HTTP.R index 503c64c..b6c24c9 100644 --- a/R/s3HTTP.R +++ b/R/s3HTTP.R @@ -236,7 +236,7 @@ parse_aws_s3_response <- function(r, Sig, verbose = getOption("verbose")){ message("Parsing AWS API response") } ctype <- httr::headers(r)[["content-type"]] - if (is.null(ctype) || ctype == "application/xml"){ + if (is.null(ctype) || grepl("application/xml", ctype)){ content <- httr::content(r, as = "text", encoding = "UTF-8") if (content != "") { response_contents <- xml2::as_list(xml2::read_xml(content))