ropensci / piggyback
Showing 1 of 1 files from the diff.

@@ -139,16 +139,29 @@
Loading
139 139
140 140
  resp <- httr::GET(
141 141
    paste0(
142 -
      "https://api.github.com/repos/", owner, "/",
143 -
      repo, "/", "releases/assets/", id,
144 -
      "?access_token=", .token
142 +
      "https://",
143 +
      "api.github.com/repos/", owner, "/",
144 +
      repo, "/", "releases/assets/", id
145 145
    ),
146 146
#    httr::authenticate(.token, "x-oauth-basic", "basic"),
147 147
    httr::add_headers(Accept = "application/octet-stream"),
148 +
    httr::add_headers(Authorization = paste("token",.token)),
148 149
    httr::write_disk(destfile, overwrite = overwrite),
149 150
    progress
150 151
  )
151 -
  ## handle error cases? resp not found
152 +
153 +
  # Try to use the redirection URL instead in case of "bad request"
154 +
  # See https://gist.github.com/josh-padnick/fdae42c07e648c798fc27dec2367da21
155 +
  if (resp$status_code == 400) {
156 +
    resp <- httr::GET(
157 +
      resp$url,
158 +
      httr::add_headers(Accept = "application/octet-stream"),
159 +
      httr::write_disk(destfile, overwrite = T),
160 +
      progress
161 +
    )
162 +
  }
163 +
164 +
  # handle error cases? resp not found
152 165
  httr::stop_for_status(resp)
153 166
  invisible(resp)
154 167
#  gh::gh(paste0(
Files Coverage
R 75.57%
Project Totals (10 files) 75.57%
1
comment: false
2

3
coverage:
4
  status:
5
    project:
6
      default:
7
        target: auto
8
        threshold: 1%
9
    patch:
10
      default:
11
        target: auto
12
        threshold: 1%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading