Skip to content

Commit

Permalink
pkgsite: 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 20, 2023
1 parent d3f7cf0 commit 9c62dbf
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 9c62dbf

Please sign in to comment.