aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/api.go
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2023-10-18 21:07:20 +0800
committerGitHub <noreply@github.com>2023-10-18 15:07:20 +0200
commitca4418eff12d92a4da29bba4331451bf6cd0b620 (patch)
treeca00e6c5ce55ba1c0eb3c78f0680cae27ca537f1 /routers/api/v1/api.go
parent80c0c8815203128703eae741e712289393458687 (diff)
downloadgitea-ca4418eff12d92a4da29bba4331451bf6cd0b620.tar.gz
gitea-ca4418eff12d92a4da29bba4331451bf6cd0b620.zip
Support allowed hosts for webhook to work with proxy (#27655) (#27674)
Backport #27655 by @wolfogre When `webhook.PROXY_URL` has been set, the old code will check if the proxy host is in `ALLOWED_HOST_LIST` or reject requests through the proxy. It requires users to add the proxy host to `ALLOWED_HOST_LIST`. However, it actually allows all requests to any port on the host, when the proxy host is probably an internal address. But things may be even worse. `ALLOWED_HOST_LIST` doesn't really work when requests are sent to the allowed proxy, and the proxy could forward them to any hosts. This PR fixes it by: - If the proxy has been set, always allow connectioins to the host and port. - Check `ALLOWED_HOST_LIST` before forwarding. Co-authored-by: Jason Song <i@wolfogre.com>
Diffstat (limited to 'routers/api/v1/api.go')
0 files changed, 0 insertions, 0 deletions