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 4c999fd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
go:
- "1.17"
- "1.18"
- "1.19"
steps:
- uses: actions/checkout@v2

Expand All @@ -25,7 +26,7 @@ jobs:

- name: Install dependencies
run: |
go install github.com/cockroachdb/crlfmt@latest
go install github.com/cockroachdb/crlfmt@024b567ce87bf2b89f2cffabb7a8f4ea0cfa8b98
go install github.com/kisielk/errcheck@latest
go install github.com/mdempsky/unconvert@latest
go install honnef.co/go/tools/cmd/staticcheck@latest
Expand Down
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 4c999fd

Please sign in to comment.