Skip to content

Commit

Permalink
Merge pull request #157 from rail/no-more-redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
rafiss authored Dec 30, 2022
2 parents 9d43af9 + 4c999fd commit 07f15fe
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 07f15fe

Please sign in to comment.