changeset 358:55388227e7da

Rewrite XML attributes in WFS proxy, too.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 07 Aug 2018 19:28:03 +0200
parents 3e96a15600b7
children ac7e0f980456 2c58906649be
files controllers/externalwfs.go
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/controllers/externalwfs.go	Tue Aug 07 18:00:53 2018 +0200
+++ b/controllers/externalwfs.go	Tue Aug 07 19:28:03 2018 +0200
@@ -59,6 +59,8 @@
 		abort("error: badly configured url for external WFS %s\n", wfs)
 	}
 
+	https := useHTTPS(req)
+
 	log.Printf("%v\n", prefix)
 	nURL := prefix + "/" + rest + "?" + req.URL.RawQuery
 	log.Printf("%v\n", nURL)
@@ -69,7 +71,7 @@
 	}
 	req.URL = u
 	req.Header.Set("X-Gemma-From", prefix)
-	to := useHTTPS(req) + "://" + req.Host + "/api/externalwfs/" + wfs
+	to := https + "://" + req.Host + "/api/externalwfs/" + wfs
 	req.Header.Set("X-Gemma-To", to)
 
 	req.Host = u.Host
@@ -233,6 +235,7 @@
 			attr := make([]xml.Attr, len(t.Attr))
 
 			for i, at := range t.Attr {
+				at.Value = replace(at.Value)
 				switch {
 				case at.Name.Space == "xmlns":
 					ns.define(at.Value, at.Name.Local)