@@ -16,7 +16,7 @@ import (
16
16
)
17
17
18
18
const (
19
- platformVersion = "1.5.10 "
19
+ platformVersion = "1.5.11 "
20
20
platformId = "53"
21
21
)
22
22
@@ -133,13 +133,13 @@ func (websdk WebSDK) validateToken(tokenString string) (valid bool, userId strin
133
133
134
134
}
135
135
136
- func (websdk WebSDK ) MakeCall (w http. ResponseWriter , r * http.Request ) (map [string ]interface {}, error ) {
136
+ func (websdk WebSDK ) MakeCall (r * http.Request ) (map [string ]interface {}, error ) {
137
137
138
138
res := make (map [string ]interface {})
139
139
140
140
if err := r .ParseMultipartForm (32 << 20 ); err != nil {
141
141
log .Println ("r.ParseMultipartForm(32 << 20) Exception: " + err .Error ())
142
- w .WriteHeader (http .StatusBadRequest )
142
+ // w.WriteHeader(http.StatusBadRequest)
143
143
// w.Write([]byte("r.ParseMultipartForm(32 << 20) Exception: " + err.Error()))
144
144
return res , errors .New ("r.ParseMultipartForm(32 << 20) Exception: " + err .Error ())
145
145
}
@@ -148,7 +148,7 @@ func (websdk WebSDK) MakeCall(w http.ResponseWriter, r *http.Request) (map[strin
148
148
149
149
if viRequestType == "" {
150
150
log .Println (`viRequestType == ""` )
151
- w .WriteHeader (http .StatusBadRequest )
151
+ // w.WriteHeader(http.StatusBadRequest)
152
152
// w.Write([]byte("viRequestType not passed"))
153
153
return res , errors .New ("viRequestType not passed" )
154
154
}
@@ -193,11 +193,9 @@ func (websdk WebSDK) MakeCall(w http.ResponseWriter, r *http.Request) (map[strin
193
193
case "createVoiceEnrollment" , "voiceVerification" :
194
194
key = "viVoiceData"
195
195
extension = ".wav"
196
- break
197
196
case "createFaceEnrollment" , "createVideoEnrollment" , "faceVerification" , "faceVerificationWithLiveness" , "videoVerificationWithLiveness" , "videoVerification" :
198
197
key = "viVideoData"
199
198
extension = ".mp4"
200
- break
201
199
}
202
200
203
201
file , header , err := r .FormFile (key )
@@ -228,7 +226,7 @@ func (websdk WebSDK) MakeCall(w http.ResponseWriter, r *http.Request) (map[strin
228
226
229
227
// Make client request to API 2/Liveness Server
230
228
} else if viRequestType == "enoughVoiceEnrollments" || viRequestType == "enoughFaceEnrollments" || viRequestType == "enoughVideoEnrollments" {
231
- return websdk .enoughEnrollments (w , viRequestType , userId )
229
+ return websdk .enoughEnrollments (res , viRequestType , userId )
232
230
// return
233
231
}
234
232
@@ -280,8 +278,7 @@ func (websdk WebSDK) MakeCall(w http.ResponseWriter, r *http.Request) (map[strin
280
278
281
279
}
282
280
283
- func (websdk WebSDK ) enoughEnrollments (w http.ResponseWriter , viRequestType , userId string ) (map [string ]interface {}, error ) {
284
- res := make (map [string ]interface {})
281
+ func (websdk WebSDK ) enoughEnrollments (res map [string ]interface {}, viRequestType , userId string ) (map [string ]interface {}, error ) {
285
282
switch viRequestType {
286
283
case "enoughVoiceEnrollments" :
287
284
var voiceEnrollmentsResponse structs.GetAllVoiceEnrollmentsReturn
@@ -299,8 +296,6 @@ func (websdk WebSDK) enoughEnrollments(w http.ResponseWriter, viRequestType, use
299
296
log .Println (`json.Unmarshal([]byte("` + string (ret ) + `"), &voiceEnrollmentsResponse) Exception: ` + err .Error ())
300
297
res ["responseCode" ] = "BERR"
301
298
res ["message" ] = err .Error ()
302
- marshaled , _ := json .Marshal (res )
303
- w .Write (marshaled )
304
299
return res , nil
305
300
}
306
301
ret , err = websdk .vi .GetAllVideoEnrollments (userId )
0 commit comments