Skip to content

Commit

Permalink
fix headers httr2 collection; fix response gathering; fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Jul 3, 2023
1 parent 2c060db commit 8b38d72
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/adapter-httr2.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
httr2_headers <- function(x) {
structure(x, class = c("httr2_headers", class(x)))
structure(x %||% list(), class = c("httr2_headers", class(x)))
}

#' Build a httr2 response (`httr2_response`)
Expand Down Expand Up @@ -36,7 +36,7 @@ build_httr2_response <- function(req, resp) {
httr2_headers(resp$response_headers)
}
},
body = resp$content
body = resp$body %||% resp$content
)
structure(lst, class = "httr2_response")
}
Expand Down Expand Up @@ -113,7 +113,7 @@ Httr2Adapter <- R6::R6Class("Httr2Adapter",
build_request = build_httr2_request,
build_response = build_httr2_response,

request_handler = function(request) vcr::RequestHandlerHttr$new(request),
request_handler = function(request) vcr::RequestHandlerHttr2$new(request),

fetch_request = function(request) httr2::req_perform(request)
)
Expand Down

0 comments on commit 8b38d72

Please sign in to comment.