Skip to content

Commit

Permalink
Merge pull request #313 from nathangoulding/master
Browse files Browse the repository at this point in the history
fix for token service account
  • Loading branch information
hadley committed Jan 5, 2016
2 parents 80e4f10 + 2b4316f commit adfe696
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@

* `build_url()` now collapses vector `path` with `/` (#280, @artemklevtsov).

* Ensure that OAuth token `sign()` returns a `request` (#313, @nathangoulding).

# httr 1.0.0

* httr no longer uses the RCurl package. Instead it uses the curl package,
Expand Down
2 changes: 1 addition & 1 deletion R/oauth-token.r
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ TokenServiceAccount <- R6::R6Class("TokenServiceAccount", inherit = Token2.0, li
config <- add_headers(
Authorization = paste('Bearer', self$credentials$access_token)
)
list(url = url, config = config)
request_build(method = method, url = url, config)
},

# Never cache
Expand Down
7 changes: 5 additions & 2 deletions R/request.R
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,11 @@ request_prepare <- function(req) {

# Sign request, if needed
token <- req$auth_token
if (!is.null(token))
req <- c(req, token$sign(req$method, req$url))
if (!is.null(token)) {
signed_req <- token$sign(req$method, req$url)
stopifnot(is.request(signed_req))
req <- c(req, signed_req)
}

req
}
Expand Down

0 comments on commit adfe696

Please sign in to comment.