changeset 423:42e64da55095

Re-added startup sql scripts when creating geoserver layers.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 16 Aug 2018 15:35:20 +0200
parents c37457f12b8e
children abe4efa339bc
files cmd/gemma/geoserver.go
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/cmd/gemma/geoserver.go	Thu Aug 16 15:17:21 2018 +0200
+++ b/cmd/gemma/geoserver.go	Thu Aug 16 15:35:20 2018 +0200
@@ -20,14 +20,14 @@
 )
 
 const (
-	startupSQL = `` // `SET SESSION AUTHORIZATION waterway_user`
-	closeupSQL = `` // `RESET SESSION AUTHORIZATION`
+	startupSQL = `SET SESSION AUTHORIZATION ${user,%s}`
+	closeupSQL = `RESET SESSION AUTHORIZATION`
 )
 
 func basicAuth(user, password string) func(req *http.Request) {
 	auth := "Basic " + misc.BasicAuth(user, password)
 	return func(req *http.Request) {
-		req.Header.Add("authorization", auth)
+		req.Header.Add("Authorization", auth)
 	}
 }
 
@@ -138,7 +138,7 @@
 					{"user", config.SysAdmin()},
 					{"passwd", config.SysAdminPassword()},
 					{"dbtype", databaseType},
-					{"Session startup SQL", startupSQL},
+					{"Session startup SQL", fmt.Sprintf(startupSQL, config.SysAdmin())},
 					{"Session close-up SQL", closeupSQL},
 				},
 			},