Skip to content

Commit

Permalink
Merge pull request #8 from shikokuchuo/main
Browse files Browse the repository at this point in the history
Check status code before trying to use the redirect location
  • Loading branch information
wlandau committed Mar 4, 2024
2 parents 3835a25 + 461d5f6 commit 821f03b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions R/assert_package.R
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,17 @@ assert_release_exists <- function(url) {
file.path(url, "releases", "latest"),
convert = FALSE
)
status <- response[["status"]]
if (status != 302L) {
return(
paste(
"Checking releases at",
shQuote(url),
"returned HTTP error",
nanonext::status_code(status)
)
)
}
found <- identical(
dirname(as.character(response$headers$Location)),
file.path(url, "releases", "tag")
Expand Down

0 comments on commit 821f03b

Please sign in to comment.