summaryrefslogtreecommitdiff
path: root/src/helsinki.at/rhimportd
diff options
context:
space:
mode:
Diffstat (limited to 'src/helsinki.at/rhimportd')
-rw-r--r--src/helsinki.at/rhimportd/ctrlWebSimple.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/helsinki.at/rhimportd/ctrlWebSimple.go b/src/helsinki.at/rhimportd/ctrlWebSimple.go
index a57e8c5..5e12df5 100644
--- a/src/helsinki.at/rhimportd/ctrlWebSimple.go
+++ b/src/helsinki.at/rhimportd/ctrlWebSimple.go
@@ -36,7 +36,6 @@ import (
type webSimpleRequestData struct {
UserName string `json:"LOGIN_NAME"`
Password string `json:"PASSWORD"`
- GroupName string `json:"GROUP_NAME"`
Cart uint `json:"CART_NUMBER"`
Cut uint `json:"CUT_NUMBER"`
Channels uint `json:"CHANNELS"`
@@ -84,7 +83,7 @@ func webSimpleParseRequest(conf *rhimport.Config, rddb *rhimport.RdDb, trusted b
if trusted {
username = r.Header.Get("X-Forwarded-User")
}
- ctx = rhimport.NewImportContext(conf, rddb, username, reqdata.GroupName)
+ ctx = rhimport.NewImportContext(conf, rddb, username)
ctx.Password = reqdata.Password
ctx.Trusted = trusted
ctx.Cart = reqdata.Cart
@@ -108,9 +107,10 @@ func webSimpleHandler(conf *rhimport.Config, rddb *rhimport.RdDb, trusted bool,
return
}
- // TODO: add a sanity check for the context:
- // it would be nice to know whether a request is bogus
- // *before* we fetch a big file!
+ if err = ctx.SanityCheck(); err != nil {
+ webSimpleErrorResponse(w, http.StatusBadRequest, err.Error())
+ return
+ }
if err = rhimport.FetchFile(ctx); err != nil {
webSimpleErrorResponse(w, http.StatusInternalServerError, err.Error())