Add parameter check for racs inbound and outbound
This commit is contained in:
parent
741adccc6b
commit
3ed70abd22
18
APIServer.go
18
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)
|
||||
}
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user