Mercurial > gemma
diff pkg/controllers/json.go @ 2058:09f9ae3d0526 unify_imports
Imports: Handle manual imports with a single route using the shortnames of the imports to distiquish between them.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 28 Jan 2019 20:35:14 +0100 |
parents | cdc8933949f2 |
children | 1458c9b0fdaa |
line wrap: on
line diff
--- a/pkg/controllers/json.go Mon Jan 28 19:30:03 2019 +0100 +++ b/pkg/controllers/json.go Mon Jan 28 20:35:14 2019 +0100 @@ -44,7 +44,7 @@ type JSONHandler struct { // Input (if not nil) is called to fill a data structure // returned by this function. - Input func() interface{} + Input func(*http.Request) interface{} // Handle is called to handle the incoming HTTP request. // in is the data structure returned by Input. Its nil if Input is nil. // req is the incoming HTTP request. @@ -79,7 +79,7 @@ var input interface{} if j.Input != nil { - input = j.Input() + input = j.Input(req) defer req.Body.Close() var r io.Reader switch {