diffs: add configurable viewer base URL (#59341)

Merged via squash.

Prepared head SHA: 3c2a84849f
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
Gustavo Madeira Santana
2026-04-02 00:31:29 -04:00
committed by GitHub
parent d55cefac00
commit 19c954bd78
14 changed files with 229 additions and 14 deletions

View File

@@ -340,6 +340,14 @@ describe("createDiffsHttpHandler", () => {
allowRemoteViewer: false,
expectedStatusCode: 404,
},
{
name: "blocks proxied loopback requests when trusted proxies are configured",
request: localReq,
headers: { "x-forwarded-for": "203.0.113.10" },
trustedProxies: ["127.0.0.1"],
allowRemoteViewer: false,
expectedStatusCode: 404,
},
{
name: "allows remote access when allowRemoteViewer is enabled",
request: remoteReq,