api: fix bugs

This commit is contained in:
George Palanjyan
2018-04-10 22:58:56 +03:00
parent 3eb889f611
commit 3eb2782699
3 changed files with 4 additions and 3 deletions

View File

@@ -21,7 +21,6 @@ func RunApi () {
router.POST("/:service/:method", func(c *gin.Context) {
serviceName := c.Param("service")
methodName := c.Param("method")
//todo: login, pass, deviceXaddr
username := c.GetHeader("username")
pass := c.GetHeader("password")
xaddr := c.GetHeader("xaddr")
@@ -227,7 +226,7 @@ func xmlMaker(lst* []interface{}, tags* []map[string]string, lstIndex int) (stri
}
func xmlProcessing (tg string) (string, error) {
r, _ := regexp.Compile(`\"(.*?)\"`)
r, _ := regexp.Compile(`"(.*?)"`)
str := r.FindStringSubmatch(tg)
if len(str) == 0 {
return "", errors.New("out of range")