~emersion/public-inbox

kimchi: Set the X-Forwarded-* headers v1 APPLIED

delthas: 1
 Set the X-Forwarded-* headers

 2 files changed, 5 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~emersion/public-inbox/patches/21751/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH kimchi] Set the X-Forwarded-* headers Export this patch

---
 directives.go | 3 +++
 kimchi.1.scd  | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/directives.go b/directives.go
index caafd0e..4d01791 100644
--- a/directives.go
+++ b/directives.go
@@ -149,6 +149,9 @@ var backends = map[string]parseBackendFunc{
			forwarded := fmt.Sprintf("for=%q;host=%q;proto=%q", req.RemoteAddr, req.Host, req.URL.Scheme)
			director(req)
			req.Header.Set("Forwarded", forwarded)
			req.Header.Set("X-Forwarded-For", req.RemoteAddr)
			req.Header.Set("X-Forwarded-Host", req.Host)
			req.Header.Set("X-Forwarded-Proto", req.URL.Scheme)
		}
		return proxy, nil
	},
diff --git a/kimchi.1.scd b/kimchi.1.scd
index 5e35bbd..1583821 100644
--- a/kimchi.1.scd
+++ b/kimchi.1.scd
@@ -69,7 +69,8 @@ The following directives are supported:

		The header fields are passed through, except _Host_ which is set to the
		target URI's. The _Forwarded_ header is set with the original remote
		IP address, port, host and protocol (see RFC 7239).
		IP address, port, host and protocol (see RFC 7239), as well as the X-Forwarded-For,
		X-Forwarded-Host and X-Forwarded-Proto headers.

	*file_server* <path> { ++
	*browse* ++
-- 
2.30.0
Pushed, thanks!