Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not use redirects for latest binaries #157

Merged
merged 1 commit into from
Dec 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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