exadel-inc / exadel-inc/compreface-javascript-sdk

recognitionService.recognize without limit parameter results in malformed url

Open
#33 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
105
Forks
42
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
If you call `recognize` without limit parameter the url is not valid and a 400 is returned from the REST API.

**To Reproduce**
```ts
try {
const result = await recognitionService.recognize(path_toTestImage, {
face_plugins: 'landmarks,gender,age',
det_prob_threshold: 0.95,
status: true
});
} catch (e) {
console.error('Error while recognize' + e.message);
console.error(e.config.url); // <-- comes here. not good
}
```
Prints
`http://localhost:8000/api/v1/recognition/recognize?det_prob_threshold=0.95?face_plugins=landmarks,gender,age?status=true`

**Expected behavior**
If I do not pass limit it should use a default or build a valid url.
Should be
`http://localhost:8000/api/v1/recognition/recognize?det_prob_threshold=0.95&face_plugins=landmarks,gender,age&status=true`

Maybe other webservers/backends do not care but I use the docker-compose version from https://github.com/exadel-inc/CompreFace/releases/tag/v1.0.0

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.