GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Convert URLs to expected format · github/codeql@baad5dd

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • go/extractor/util
    • registryproxy.go
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎go/extractor/util/registryproxy.go‎

Copy file name to clipboardExpand all lines: go/extractor/util/registryproxy.go
+7-4Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"encoding/json"
55
"fmt"
66
"log/slog"
7+
"net/url"
78
"os"
89
"os/exec"
910
"strings"
@@ -103,12 +104,14 @@ func getEnvVars() []string {
103104
goproxy_servers = append(goproxy_servers, cfg.URL)
104105
slog.Info("Found GOPROXY server", slog.String("url", cfg.URL))
105106
} else if cfg.Type == GIT_SOURCE {
106-
if strings.HasSuffix(cfg.URL, "*") {
107-
git_sources = append(git_sources, cfg.URL)
107+
parsed, err := url.Parse(cfg.URL)
108+
if err == nil && parsed.Hostname() != "" {
109+
git_source := parsed.Hostname() + parsed.Path + "*"
110+
git_sources = append(git_sources, git_source)
111+
slog.Info("Found Git source", slog.String("source", git_source))
108112
} else {
109-
git_sources = append(git_sources, cfg.URL+"*")
113+
slog.Warn("Not a valid URL for Git source", slog.String("url", cfg.URL))
110114
}
111-
slog.Info("Found Git source", slog.String("url", cfg.URL))
112115
}
113116
}
114117

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.