Skip to content

Commit

Permalink
Fix an issue in R client wrapping of extra headers. (deephaven#4357)
Browse files Browse the repository at this point in the history
* Fix an issue in R client wrapping of extra headers.

* Fix an issue with the call to set_use_tls.
  • Loading branch information
jcferretti committed Aug 23, 2023
1 parent df3740e commit 5c95d36
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 5 additions & 5 deletions R/rdeephaven/R/client_wrapper.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ setMethod(

# if tls is requested, set it and set the root_certs if provided
if (use_tls == TRUE) {
options$set_use_tls()
options$set_use_tls(TRUE)
if (tls_root_certs != "") {
verify_string("tls_root_certs", tls_root_certs, TRUE)
options$set_tls_root_certs(tls_root_certs)
Expand All @@ -82,7 +82,7 @@ setMethod(

# set extra header options if they are provided
if (length(int_options) != 0) {
verify_list("int_options", int_options, TRUE)
verify_list("int_options", int_options)
for (key in names(int_options)) {
verify_string("key", key, TRUE)
verify_int("value", int_options[[key]], TRUE)
Expand All @@ -91,7 +91,7 @@ setMethod(
}

if (length(string_options) != 0) {
verify_list("string_options", string_options, TRUE)
verify_list("string_options", string_options)
for (key in names(string_options)) {
verify_string("key", key, TRUE)
verify_string("value", string_options[[key]], TRUE)
Expand All @@ -100,11 +100,11 @@ setMethod(
}

if (length(extra_headers) != 0) {
verify_list("extra_headers", extra_headers, TRUE)
verify_list("extra_headers", extra_headers)
for (key in names(extra_headers)) {
verify_string("key", key, TRUE)
verify_string("value", extra_headers[[key]], TRUE)
options$add_extra_headers(key, extra_headers[[key]])
options$add_extra_header(key, extra_headers[[key]])
}
}

Expand Down
6 changes: 4 additions & 2 deletions R/rdeephaven/R/helper_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ verify_numeric <- function(arg_name, candidate, is_scalar) {
verify_type(arg_name, candidate, "numeric", "numeric", is_scalar)
}

verify_list <- function(arg_name, candidate, is_scalar) {
verify_type(arg_name, candidate, "list", "list", is_scalar)
verify_list <- function(arg_name, candidate) {
if (first_class(candidate) != "list") {
stop(paste0("'", arg_name, "' must be a list."))
}
}

verify_in_unit_interval <- function(arg_name, candidate, is_scalar) {
Expand Down

0 comments on commit 5c95d36

Please sign in to comment.