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

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