Skip to content

Commit

Permalink
Do not use redirects for latest binaries
Browse files Browse the repository at this point in the history
After we moved the edge CDN to GCS-backed Google CDN, the latest
binaries became actual binaries, without redirects, as it was before.

This PR removes the redirect resolution logic.
  • Loading branch information
rail committed Dec 30, 2022
1 parent 9d43af9 commit f30220a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.#*
*.test
testserver/cockroach-data/
testserver/temp_binaries/
12 changes: 1 addition & 11 deletions testserver/binaries.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"io"
"io/ioutil"
"log"
"mime"
"net/http"
"net/url"
"os"
Expand Down Expand Up @@ -234,16 +233,7 @@ func GetDownloadFilename(
response *http.Response, nonStableDB bool, desiredVersion string,
) (string, error) {
if nonStableDB {
const contentDisposition = "Content-Disposition"
_, disposition, err := mime.ParseMediaType(response.Header.Get(contentDisposition))
if err != nil {
return "", fmt.Errorf("error parsing %s headers %s: %w", contentDisposition, response.Header, err)
}
filename, ok := disposition["filename"]
if !ok {
return "", fmt.Errorf("content disposition header %s did not contain filename", disposition)
}
return filename, nil
log.Printf("Obsolete usage of GetDownloadFilename() with `nonStable` set to `true`")
}
filename := fmt.Sprintf("cockroach-%s", desiredVersion)
if runtime.GOOS == "windows" {
Expand Down

0 comments on commit f30220a

Please sign in to comment.