From f3d19bf6d4f868644aea9004ed774efad9ce8706 Mon Sep 17 00:00:00 2001 From: clsr Date: Tue, 22 Aug 2017 11:58:26 +0200 Subject: Fix external cnp:// URLs in gateway mode --- cnhttp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cnhttp.go') diff --git a/cnhttp.go b/cnhttp.go index 42f723d..ab251af 100644 --- a/cnhttp.go +++ b/cnhttp.go @@ -573,7 +573,7 @@ func (srv *server) linkToURL(req *cnp.Request, link string) (urlStr, extern stri host = req.Host() } if u, err := url.Parse(link); err == nil { - if u.Scheme == "cnp" { + if u.Scheme == "cnp" && (srv.host == "" || u.Host == srv.host) { var lhost, lpath string lhost = u.Host lpath = u.Path -- cgit