From 6d3d3b13cb880e6f44a8f63940a0728ce7736bb5 Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Fri, 13 Jun 2025 07:53:19 -0500 Subject: [PATCH] `create_response()` already sets the last response --- R/req-perform-connection.R | 4 +--- R/req-perform.R | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/R/req-perform-connection.R b/R/req-perform-connection.R index c172b3b7..acca9d73 100644 --- a/R/req-perform-connection.R +++ b/R/req-perform-connection.R @@ -140,9 +140,7 @@ req_perform_connection1 <- function(req, handle, blocking = TRUE) { } curl_data <- curl::handle_data(handle) - - the$last_response <- create_response(req, curl_data, body) - the$last_response + create_response(req, curl_data, body) } # Make open mockable diff --git a/R/req-perform.R b/R/req-perform.R index a89b69c9..ca3115ad 100644 --- a/R/req-perform.R +++ b/R/req-perform.R @@ -190,8 +190,7 @@ req_perform1 <- function(req, path = NULL, handle = NULL) { curl::handle_setopt(handle, cookielist = "FLUSH") curl::handle_setopt(handle, cookiefile = NULL, cookiejar = NULL) - the$last_response <- create_response(req, fetch$curl_data, fetch$body) - the$last_response + create_response(req, fetch$curl_data, fetch$body) } curl_fetch <- function(handle, url, path) {