几乎可以肯定是由于 SSRF 保护 的修复。
Gitlab 将 git clone 从 https://gitlab.com/silentboatman/discourse-masonry-image-gallery 重定向为 301 到 https://gitlab.com/silentboatman/discourse-masonry-image-gallery.git/(注意,以 .git/ 结尾),但 git 调用时使用了 -c http.followRedirects=false,因此失败了。
直接输入 https://gitlab.com/silentboatman/discourse-masonry-image-gallery.git/ 作为仓库 URL 不起作用,因为 FinalDestination.resolve(@uri.to_s) 会将其改回 https://gitlab.com/silentboatman/discourse-masonry-image-gallery,原因在于,您可能不会相信,当在 git 外部请求时,重定向会反向进行!Gitlab 会将 https://gitlab.com/silentboatman/discourse-masonry-image-gallery.git/ 重定向为 302 到 https://gitlab.com/silentboatman/discourse-masonry-image-gallery。
编辑:使用 GIT_CURL_VERBOSE=1,我能够看到 Git 在克隆时会附加 info/refs?service=git-upload-pack,因此
GET /silentboatman/discourse-masonry-image-gallery/info/refs?service=git-upload-pack HTTP/2
会重定向到
location: https://gitlab.com/silentboatman/discourse-masonry-image-gallery.git/info/refs?service=git-upload-pack