diff options
Diffstat (limited to 'src/helsinki.at/rhimportd/ctrlWebSimple.go')
-rw-r--r-- | src/helsinki.at/rhimportd/ctrlWebSimple.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/helsinki.at/rhimportd/ctrlWebSimple.go b/src/helsinki.at/rhimportd/ctrlWebSimple.go index 8080514..f4c64ee 100644 --- a/src/helsinki.at/rhimportd/ctrlWebSimple.go +++ b/src/helsinki.at/rhimportd/ctrlWebSimple.go @@ -67,7 +67,7 @@ func webSimpleResponse(w http.ResponseWriter) { encoder.Encode(respdata) } -func webSimpleParseRequest(conf *rhimport.Config, trusted bool, r *http.Request) (ctx *rhimport.ImportContext, err error) { +func webSimpleParseRequest(conf *rhimport.Config, rddb *rhimport.RDDB, trusted bool, r *http.Request) (ctx *rhimport.ImportContext, err error) { decoder := json.NewDecoder(r.Body) var reqdata webSimpleRequestData @@ -80,7 +80,7 @@ func webSimpleParseRequest(conf *rhimport.Config, trusted bool, r *http.Request) if trusted { username = r.Header.Get("X-Forwarded-User") } - ctx = rhimport.NewImportContext(conf, username, reqdata.GroupName) + ctx = rhimport.NewImportContext(conf, rddb, username, reqdata.GroupName) ctx.Password = reqdata.Password ctx.Trusted = trusted ctx.Cart = reqdata.Cart @@ -93,12 +93,12 @@ func webSimpleParseRequest(conf *rhimport.Config, trusted bool, r *http.Request) return } -func webSimpleHandler(conf *rhimport.Config, trusted bool, w http.ResponseWriter, r *http.Request) { +func webSimpleHandler(conf *rhimport.Config, rddb *rhimport.RDDB, trusted bool, w http.ResponseWriter, r *http.Request) { rhdl.Printf("SimpleHandler: request for '%s'", html.EscapeString(r.URL.Path)) var ctx *rhimport.ImportContext var err error - if ctx, err = webSimpleParseRequest(conf, trusted, r); err != nil { + if ctx, err = webSimpleParseRequest(conf, rddb, trusted, r); err != nil { webSimpleErrorResponse(w, http.StatusInternalServerError, err.Error()) return } |