weixin_39818014
weixin_39818014
2020-12-09 03:48

internal/dl: Redirect sha256 checksum to https://dl.google.com/go

The download of a Go release redirects to https://dl.google.com/go but the download of the same release's sha256 checksum does not.

For example:


$ curl https://golang.org/dl/go1.15.2.linux-amd64.tar.gz
<a href="https://dl.google.com/go/go1.15.2.linux-amd64.tar.gz">Found</a>.

$ curl https://golang.org/dl/go1.15.2.linux-amd64.tar.gz.sha256



<meta name="go-import" content="golang.org/dl git
https://go.googlesource.com/dl">
<meta http-equiv="refresh" content="0;
url=https://golang.org/dl/#go1.15.2.linux-amd64.tar.gz.sha256">


Nothing to see here; <a href="https://golang.org/dl/#go1.15.2.linux-amd64.tar.gz.sha256">move
along</a>.



The sha256 checksum is avaialbe at https://dl.google.com/go by appending .sha256 to the end of a release URL:


$ curl https://dl.google.com/go/go1.15.2.linux-amd64.tar.gz.sha256
b49fda1ca29a1946d6bb2a5a6982cf07ccd2aba849289508ee0f9918f6bb4552%

It would be nice that a release's sha256 can be redirected from https://golang.org/dl to https://dl.google.com/go, the same as its corresponding release. This makes the download of a release and its checksum both accessible from https://golang.org/dl.

To summarize,

  1. :heavy_check_mark: curl https://golang.org/dl/go1.15.2.linux-amd64.tar.gz -> https://dl.google.com/go/go1.15.2.linux-amd64.tar.gz
  2. :no_entry_sign: curl https://golang.org/dl/go1.15.2.linux-amd64.tar.gz.sha256 -> curl https://dl.google.com/go/go1.15.2.linux-amd64.tar.gz.sha256
  3. :heavy_check_mark: curl https://dl.google.com/go/go1.15.2.linux-amd64.tar.gz
  4. :heavy_check_mark: curl https://dl.google.com/go/go1.15.2.linux-amd64.tar.gz.sha256

This PR fixes #2 by changing the regexp of the file name matching for redirection.

该提问来源于开源项目:golang/website

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

6条回答

  • weixin_39718006 weixin_39718006 4月前

    Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

    :memo: Please visit https://cla.developers.google.com/ to sign.

    Once you've signed (or fixed any issues), please reply here with I signed it! and we'll verify it.

    What to do if you already signed the CLA

    Individual signers
    Corporate signers

    ℹ️ Googlers: Go here for more info.

    点赞 评论 复制链接分享
  • weixin_39818014 weixin_39818014 4月前

    I signed it!

    点赞 评论 复制链接分享
  • weixin_39768388 weixin_39768388 4月前

    This PR (HEAD: 031ea71c91adfee959ad2423727806be28265a94) has been imported to Gerrit for code review.

    Please visit https://go-review.googlesource.com/c/website/+/261117 to see it.

    Tip: You can toggle comments from me using the comments slash command (e.g. /comments off) See the Wiki page for more info

    点赞 评论 复制链接分享
  • weixin_39768388 weixin_39768388 4月前

    Message from Gobot Gobot:

    Patch Set 1:

    Congratulations on opening your first change. Thank you for your contribution!

    Next steps: A maintainer will review your change and provide feedback. See https://golang.org/doc/contribute.html#review for more info and tips to get your patch through code review.

    Most changes in the Go project go through a few rounds of revision. This can be surprising to people new to the project. The careful, iterative review process is our way of helping mentor contributors and ensuring that their contributions have a lasting impact.

    Please don’t reply on this GitHub thread. Visit golang.org/cl/261117. After addressing review feedback, remember to publish your drafts!

    点赞 评论 复制链接分享
  • weixin_39768388 weixin_39768388 4月前

    Message from Go Bot:

    Patch Set 1:

    Congratulations on opening your first change. Thank you for your contribution!

    Next steps: A maintainer will review your change and provide feedback. See https://golang.org/doc/contribute.html#review for more info and tips to get your patch through code review.

    Most changes in the Go project go through a few rounds of revision. This can be surprising to people new to the project. The careful, iterative review process is our way of helping mentor contributors and ensuring that their contributions have a lasting impact.

    Please don’t reply on this GitHub thread. Visit golang.org/cl/261117. After addressing review feedback, remember to publish your drafts!

    点赞 评论 复制链接分享
  • weixin_39768388 weixin_39768388 4月前

    Message from Owen Ou:

    Patch Set 5:

    (1 comment)

    Please don’t reply on this GitHub thread. Visit golang.org/cl/261117. After addressing review feedback, remember to publish your drafts!

    点赞 评论 复制链接分享