Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the default failure in parse_http_date() to NA with class Date #544

Merged
merged 3 commits into from
Nov 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# httr 1.3.1.9000

* The default value of `failure` argument in `parse_http_date()` is set to `structure(NA_real_, class = "Date")` so that the reponse with a "failure" date can be printed out correctly. (@shrektan, #544)

# httr 1.3.1

* Re-enable on-disk caching (accidentally disabled in #457) (#475)
Expand Down
2 changes: 1 addition & 1 deletion R/date.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#' parse_http_date("Sun Nov 6 08:49:37 1994")
#'
#' http_date(Sys.time())
parse_http_date <- function(x, failure = NA) {
parse_http_date <- function(x, failure = structure(NA_real_, class = "Date")) {
if (length(x) == 0) return(NULL)

fmts <- c(
Expand Down
2 changes: 1 addition & 1 deletion man/parse_http_date.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.