feat(gitea): support extra outbound HTTP headers via GITEA_EXTRA_HEADERS

Add a GITEA_EXTRA_HEADERS environment variable that accepts a JSON
object of header name/value pairs (e.g. Cloudflare Access
credentials) and applies them to every outbound request to Gitea,
both the raw pkg/gitea.DoJSON/DoBytes path and the SDK-backed
pkg/gitea.NewClient path, without overriding Authorization,
Content-Type, or Accept.

Co-Authored-By: Codet <codet@commitgo.dev> (GPT-5-Codex)
This commit is contained in:
Lunny Xiao
2026-08-23 23:33:36 -07:00
parent 815a0e26aa
commit 6744cab627
8 changed files with 197 additions and 3 deletions
+3
View File
@@ -1,5 +1,7 @@
package flag
import "net/http"
var (
Host string
Bind string
@@ -15,4 +17,5 @@ var (
Debug bool
AllowedTools map[string]struct{}
AllowedScopes map[string]struct{}
ExtraHeaders http.Header
)