Skip to content

Commit cb01cd4

Browse files
committed
Set X-Forwarded headers
1 parent 00e4c85 commit cb01cd4

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/lint-test-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040

4141
run:
4242
needs: [lint-test]
43-
uses: libops/.github/.github/workflows/build-push-ghcr.yaml@main
43+
uses: libops/.github/.github/workflows/build-push.yaml@main
4444
permissions:
4545
contents: read
4646
packages: write

main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ func main() {
117117
return
118118
}
119119

120+
r.Header.Set("X-Forwarded-Host", r.Host)
121+
if r.Header.Get("X-Forwarded-Proto") == "" {
122+
r.Header.Set("X-Forwarded-Proto", "https")
123+
}
124+
120125
p.SetRequestHeaders(r)
121126
p.SetHost()
122127
p.ServeHTTP(w, r)

0 commit comments

Comments
 (0)