Skip to content

Commit

Permalink
Allow using non-https over localhost for the index
Browse files Browse the repository at this point in the history
  • Loading branch information
Jille committed Aug 19, 2023
1 parent d3f7cf0 commit edd1894
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/index/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func New(rawurl string) (_ *Client, err error) {
if err != nil {
return nil, fmt.Errorf("url.Parse(%q): %v", rawurl, err)
}
if u.Scheme != "https" {
if u.Scheme != "https" && (u.Scheme != "http" || u.Hostname() != "localhost") {
return nil, fmt.Errorf("scheme must be https (got %s)", u.Scheme)
}
return &Client{url: strings.TrimRight(rawurl, "/"), httpClient: &http.Client{Transport: &ochttp.Transport{}}}, nil
Expand Down

0 comments on commit edd1894

Please sign in to comment.