-
Notifications
You must be signed in to change notification settings - Fork 2k
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
add support for variable host and port as suggested in #210 #211
Conversation
@hadley ping. I know httr is still in the queue behind lots of other good stuff; but this is a quick fix to an issue that bites me regularly. (I'd just use my branch but seems weird to tell users to do that) |
I'll add httr to my list of packages that need updates (it's currently behind devtools and tidyr) |
Could you add a bullet point to NEWS please? |
@@ -7,10 +7,13 @@ | |||
#' \code{\link{oauth_app}} | |||
#' @param permission optional, a string of permissions to ask for. | |||
#' @param is_interactive Is the current environment interactive? | |||
#' @param host ip address for the listener |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@inheritParams ouath_listener
would be a bit DRYer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for these, will do
On Mon, May 4, 2015, 11:41 AM Hadley Wickham notifications@github.com
wrote:
In R/oauth-init.R
#211 (comment):@@ -7,10 +7,13 @@
#' \code{\link{oauth_app}}
#' @param permission optional, a string of permissions to ask for.
#' @param is_interactive Is the current environment interactive?
+#' @param host ip address for the listener@inheritParams ouath_listener would be a bit DRYer
—
Reply to this email directly or view it on GitHub
https://github.com/hadley/httr/pull/211/files#r29610720.
Thanks! |
@hadley Now I realize that it probably would have been better to set the default of the function argument to something like To my thinking, a better implementation would actually check the environmental variable for the default, since I could then set something like |
@hadley More problematically, I'm worried that this PR might have introduced a bug to oauth as well. I currently get the following error with traceback:
If I go into the environment at
even though at |
An env var seems ok to me, but it should be something like I can't replicate the bug you're seeing |
@hadley It's definitely a bug. Looks like I should have edited the R6 Token class to include the My apologies, I completely overlooked what was going on in the R6 classes when working out this pull request but @richfitz set me straight.
should replicate this issue(?) It looks like I need to modify https://github.com/cboettig/httr/blob/master/R/oauth-token.r#L40-73 to include |
I think you'll need to add a listener field that stores the host and port (and anything else that might come up in the future) |
Work around listener errors introduced in #211
A heck, here's a PR to implement this anyway, that just makes
host
andport
into optional function arguments. Let me know if you'd rather it were done differently. Many thanks