Changes for modern httr2 - #558
Open
sckott wants to merge 7 commits into
Open
Conversation
- update minimum httr2 version - remove modern_httr2() toggle - replace internal list2str with httr2::url_query_build
…er httr2 versions
hadley
reviewed
Jul 18, 2026
| if (modern_httr2()) { | ||
| return(getNamespace("httr2")$req_get_method(req)) | ||
| check_httr2_version <- function(call = rlang::caller_env()) { | ||
| if (!is_installed("httr2", version = "1.2.0")) { |
Member
There was a problem hiding this comment.
You can use check_required() here
Collaborator
Author
There was a problem hiding this comment.
I assume you meant check_installed here?
Member
|
Why do we still need |
Collaborator
Author
What i'm proposing is to change the function to (or similar): request_headers_redact <- function(headers) {
matches <- match("authorization", tolower(names(headers)))
matches <- matches[!is.na(matches)]
if (length(matches) == 0) {
headers
} else {
headers[-matches]
}
}Because we still want to automatically remove Authorization headers across all http clients, yes? |
Member
|
Oh gotcha. If it's used for other backends, then you'll need to keep it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #532
The one thing I'm not sure about this https://github.com/ropensci/vcr/blob/main/R/serialize-headers.R#L48 We still need the function but should we change for modern httr2?