mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-05 04:23:24 +09:00
fix(httplib): prevent leaking localhost:3000 in public links (#39217)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
co-authored by
wxiaoguang
parent
52fcd2d2a0
commit
bcd913a4e2
@@ -19,6 +19,7 @@ import (
|
||||
"gitea.dev/modules/cache"
|
||||
"gitea.dev/modules/git"
|
||||
"gitea.dev/modules/httpcache"
|
||||
"gitea.dev/modules/httplib"
|
||||
"gitea.dev/modules/log"
|
||||
"gitea.dev/modules/paginator"
|
||||
"gitea.dev/modules/reqctx"
|
||||
@@ -257,8 +258,8 @@ func APIContexter() func(http.Handler) http.Handler {
|
||||
Repo: &Repository{},
|
||||
Org: &APIOrganization{},
|
||||
}
|
||||
|
||||
ctx.SetContextValue(apiContextKey, ctx)
|
||||
httplib.MarkRequestSupportPublicURL(ctx)
|
||||
|
||||
// FIXME: GLOBAL-PARSE-FORM: see more details in another FIXME comment
|
||||
if ctx.Req.Method == http.MethodPost && strings.Contains(ctx.Req.Header.Get("Content-Type"), "multipart/form-data") {
|
||||
|
||||
Reference in New Issue
Block a user