aboutcode-org / purldb

Tools to create and expose a database of purls (Package URLs). This project is sponsored by NLnet project https://nlnet.nl/project/vulnerabilitydatabase/ and nexB for https://www.aboutcode.org/ Chat is at https://gitter.im/aboutcode-org/discuss
https://purldb.readthedocs.io/
35 stars 23 forks source link

Support go get/go import redirects #510

Open pombredanne opened 4 months ago

pombredanne commented 4 months ago

For instance: golang.org/x/text is effectively from a git repo at git https://go.googlesource.com/text

The URL at https://golang.org/x/text serves this:

<!DOCTYPE html>
<html lang="en">
<title>The Go Programming Language</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="go-import" content="golang.org/x/text git https://go.googlesource.com/text">
<meta http-equiv="refresh" content="0; url=https://pkg.go.dev/golang.org/x/text">
</head>
<body>
<a href="https://pkg.go.dev/golang.org/x/text">Redirecting to documentation...</a>
</body>
</html>

And go.roman.zone/go-get-redirect is serving this redirect:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="go-import" content="go.roman.zone/go-get-redirect git https://github.com/gentlecat/go-get-redirect.git">
</head>
<body>
See <a href="https://pkg.go.dev/go.roman.zone/go-get-redirect">https://pkg.go.dev/go.roman.zone/go-get-redirect</a> for documentation.
<script type="032e2f5629592120b938c4dd-text/javascript">
      window.location = "https://pkg.go.dev/go.roman.zone/go-get-redirect"
    </script>
<script src="/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js" data-cf-settings="032e2f5629592120b938c4dd-|49" defer></script></body>
</html>

See also: