Skip to content
This repository has been archived by the owner on Nov 6, 2022. It is now read-only.

Commit

Permalink
Support releases-api returned content-type (hashicorp#57)
Browse files Browse the repository at this point in the history
* Support releases-api returned content-type

Signed-off-by: Scott Macfarlane <smacfarlane@hashicorp.com>

* Set Go to v1.18 when building consul from source

Signed-off-by: Scott Macfarlane <smacfarlane@hashicorp.com>

* remove unused variables

Co-authored-by: Radek Simko <radek.simko@gmail.com>
  • Loading branch information
2 people authored and shoenig committed May 10, 2022
1 parent f04c420 commit 168fd41
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/releasesjson/releases.go
Expand Up @@ -79,7 +79,7 @@ func (r *Releases) ListProductVersions(ctx context.Context, productName string)
}

contentType := resp.Header.Get("content-type")
if contentType != "application/json" {
if contentType != "application/json" && contentType != "application/vnd+hashicorp.releases-api.v0+json" {
return nil, fmt.Errorf("unexpected Content-Type: %q", contentType)
}

Expand Down Expand Up @@ -144,7 +144,7 @@ func (r *Releases) GetProductVersion(ctx context.Context, product string, versio
}

contentType := resp.Header.Get("content-type")
if contentType != "application/json" {
if contentType != "application/json" && contentType != "application/vnd+hashicorp.releases-api.v0+json" {
return nil, fmt.Errorf("unexpected Content-Type: %q", contentType)
}

Expand Down
1 change: 1 addition & 0 deletions product/consul.go
@@ -1,5 +1,6 @@
package product


const consulName = "consul"

var Consul = Product{
Expand Down

0 comments on commit 168fd41

Please sign in to comment.