【发布时间】:2021-12-09 08:55:12
【问题描述】:
我有一个脚本,我希望能够通过 curl 命令访问它的 https://raw.githubusercontent.com/... 位置。使用 git.io,很容易将此 URL 缩短为 https://git.io/ABCDE 之类的内容。
但是有一个问题与我的脚本存在于私有存储库中这一事实有关。如果我直接卷曲 githubusercontent URL,我会得到 404: Not Found。我可以通过在请求中传递授权标头来绕过它,例如
$ curl -H "Authorization: token <My Github Personal Access Token>" \
https://raw.githubusercontent.com/...
> !#/bin/bash
... # rest of script
但是,当我使用缩短的 URL 时,我什么也得不到。甚至没有 404。
$ curl -H "Authorization: token <My Github Personal Access Token>" \
https://git.io/ABCDE
$
有人知道这里发生了什么吗?
【问题讨论】: