~netlandish/links-dev

links: Correct IP extraction logic for api server. v1 APPLIED

Peter Sanchez: 1
 Correct IP extraction logic for api server.

 1 files changed, 2 insertions(+), 2 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.code.netlandish.com/~netlandish/links-dev/patches/117/mbox | git am -3
Learn more about email & git

[PATCH links] Correct IP extraction logic for api server. Export this patch

Changelog-fixed: IP detection for api server under nginx reverse proxy.
Signed-off-by: Peter Sanchez <peter@netlandish.com>
---
 cmd/api/main.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmd/api/main.go b/cmd/api/main.go
index c9f0a7b..5546df4 100644
--- a/cmd/api/main.go
+++ b/cmd/api/main.go
@@ -104,8 +104,8 @@ func run() error {

	e := echo.New()
	// https://echo.labstack.com/docs/ip-address
	// Deployed via Caddy at the moment which uses X-Forwarded-For header by default
	e.IPExtractor = echo.ExtractIPFromXFFHeader()
	// nginx default instead of Caddy default.
	e.IPExtractor = echo.ExtractIPFromRealIPHeader()

	// email work queue and service, general task queue
	eq := email.NewQueue(eSize)
-- 
2.47.2
Applied.

To git@git.code.netlandish.com:~netlandish/links
   536b6d2..b614e0a  master -> master