|
@@ -34,14 +34,14 @@ func (g *Gateway) ExtAPIHandler(w http.ResponseWriter, r *http.Request) {
|
|
|
subpathElements := strings.Split(requestURI[1:], "/")
|
|
|
|
|
|
// check if it contains only two part, [rexec uuid]
|
|
|
- if len(subpathElements) != 2 {
|
|
|
+ if len(subpathElements) != 3 {
|
|
|
common.SendErrorResponse(w, "Bad Request, invaild request sent")
|
|
|
return
|
|
|
}
|
|
|
|
|
|
// check if UUID exists in the database
|
|
|
// get the info from the database
|
|
|
- data, isExist := g.checkIfExternalEndpointExist(subpathElements[1])
|
|
|
+ data, isExist := g.checkIfExternalEndpointExist(subpathElements[2])
|
|
|
if !isExist {
|
|
|
common.SendErrorResponse(w, "Bad Request, invaild UUID entered")
|
|
|
return
|
|
@@ -98,6 +98,8 @@ func (g *Gateway) AddExternalEndPoint(w http.ResponseWriter, r *http.Request) {
|
|
|
jsonStr, _ := json.Marshal(dat)
|
|
|
|
|
|
sysdb.Write("external_agi", id, string(jsonStr))
|
|
|
+
|
|
|
+ sendOK(w)
|
|
|
}
|
|
|
|
|
|
func (g *Gateway) RemoveExternalEndPoint(w http.ResponseWriter, r *http.Request) {
|