Skip to content

Commit

Permalink
#157 change to Request$new() call within RequestHandler$initialize
Browse files Browse the repository at this point in the history
uses webmockr::pluck_body which returns NULL if the body is empty
if pluck_body gives NULL, change it to an empty string "" to match what is on disk in cassettes
  • Loading branch information
sckott committed Feb 20, 2020
1 parent 980d9c8 commit 2906eca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/request_handler.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ RequestHandler <- R6::R6Class(
self$request_original <- request
self$request <- {
Request$new(request$method, request$url$url %||% request$url,
webmockr::pluck_body(request), request$headers,
webmockr::pluck_body(request) %||% "", request$headers,
disk = !is.null(request$output$path))
}
self$cassette <- tryCatch(current_cassette(), error = function(e) e)
Expand Down

0 comments on commit 2906eca

Please sign in to comment.