mirror of
https://github.com/go-gitea/gitea.git
synced 2026-07-21 22:05:17 +02:00
16 lines
666 B
Go
16 lines
666 B
Go
// Copyright 2026 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package git
|
|
|
|
import "gitea.dev/modules/git/gitcmd"
|
|
|
|
func HandleGitCmdHTTPRedirection(cmd *gitcmd.Command, targets ...string) {
|
|
// Protect from SSRF vector (e.g. migrating from an attacker URL).
|
|
// cmd.AddConfig("http.followRedirects", "false")
|
|
// However, we can't do so at the moment:
|
|
// this fails due to 301: git -c http.followRedirects=false clone -v https://gitlab.com/{owner}/{repo}
|
|
// this succeeds: git -c http.followRedirects=false clone -v https://gitlab.com/{owner}/{repo}.git
|
|
// FIXME: GIT-CLONE-HTTP-REDIRECT-SSRF: need a complete solution in the future
|
|
}
|