diff --git a/APIServer.go b/APIServer.go index dd781e3..7e73ee8 100644 --- a/APIServer.go +++ b/APIServer.go @@ -496,6 +496,15 @@ func handleRacsInbound(w http.ResponseWriter, r *http.Request) { return } + if params["USN"] == "" { + logger.Printf("[ERR] %s; %s; %#v; %s\r\n", r.RemoteAddr, r.RequestURI, params, rst["ErrMsg"]) + rst["Result"] = "NG" + rst["ErrMsg"] = "racs.HandleInbound: Missing Parameter - USN" + w.WriteHeader(http.StatusBadRequest) + fmt.Fprintf(w, "%v", strings.ReplaceAll(fmt.Sprintf("%#v", rst), "map[string]string", "")) + return + } + if cfg.Settings.LogRequest { logger.Printf("[MSG] %s; %s; Request: %#v\r\n", addr, uri, params) } @@ -534,6 +543,15 @@ func handleRacsOutbound(w http.ResponseWriter, r *http.Request) { return } + if params["USN"] == "" { + logger.Printf("[ERR] %s; %s; %#v; %s\r\n", r.RemoteAddr, r.RequestURI, params, rst["ErrMsg"]) + rst["Result"] = "NG" + rst["ErrMsg"] = "racs.HandleInbound: Missing Parameter - USN" + w.WriteHeader(http.StatusBadRequest) + fmt.Fprintf(w, "%v", strings.ReplaceAll(fmt.Sprintf("%#v", rst), "map[string]string", "")) + return + } + if cfg.Settings.LogRequest { logger.Printf("[MSG] %s; %s; Request: %#v\r\n", addr, uri, params) } diff --git a/APIServer.yml b/APIServer.yml index 7ee290b..6c3d3b4 100644 --- a/APIServer.yml +++ b/APIServer.yml @@ -13,8 +13,8 @@ MySQL: Database: ewsv3_f715 User: apisvc Password: wcqte - IssuesTable: issues StorageTable: racs + IssuesTable: issues IssuesView: v_issues OfflineView: v_offline Remark: