-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable sending blank request headers
- Loading branch information
Showing
3 changed files
with
16 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,6 +103,16 @@ test_that("setting request headers", { | |
expect_length(curl:::handle_getheaders(h), 0) | ||
}) | ||
|
||
|
||
test_that("Set blank and NULL headers", { | ||
skip_if_not_installed('httpuv') | ||
skip_if_not_installed('webutils') | ||
h <- new_handle(url = 'https://httpbin.org/get') | ||
handle_setheaders(h, "accept-encoding" = "", "accept" = "", "user-agent" = "", foo = " ", bar = "\t") | ||
req <- curl::curl_echo(h) | ||
expect_equal(req$headers, c(bar = "", foo = "", host = "httpbin.org")) | ||
}) | ||
|
||
test_that("Custom vector options", { | ||
h <- new_handle() | ||
x <- c("[email protected]", "[email protected]") | ||
|