File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -282,9 +282,11 @@ url_build <- function(url) {
282
282
# curl url parser esacapes colons in paths which google seems to use
283
283
# quite frequently. So we hack the problem away for now, restoring the
284
284
# behaviour of httr2 1.1.2
285
- path <- curl :: curl_parse_url(url , decode = FALSE )$ path
286
- path <- gsub(" %3A" , " :" , path )
287
- curl :: curl_modify_url(url , path = I(path ))
285
+ if (grepl(" %3A" , url , fixed = TRUE )) {
286
+ path <- curl :: curl_parse_url(url , decode = FALSE )$ path
287
+ path <- gsub(" %3A" , " :" , path , fixed = TRUE )
288
+ curl :: curl_modify_url(url , path = I(path ))
289
+ }
288
290
}
289
291
290
292
# ' Parse query parameters and/or build a string
Original file line number Diff line number Diff line change @@ -103,8 +103,8 @@ test_that("encodes params and paths", {
103
103
104
104
test_that(" colons in paths are left as is" , {
105
105
expect_equal(
106
- url_modify(" https://example.com" , path = " a:b" ),
107
- " https://example.com/a:b"
106
+ url_modify(" https://example.com" , path = " a:b/foo bar/ " ),
107
+ " https://example.com/a:b/foo%20bar/ "
108
108
)
109
109
})
110
110
You can’t perform that action at this time.
0 commit comments