Skip to content
Snippets Groups Projects
Commit b5ad5141 authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

Validate pubkey format when calling /wot/requirements/:search?pubkey

parent f0f47467
No related branches found
No related tags found
1 merge request!1422Optimize response time of `/wot/requirements/:search`
......@@ -189,6 +189,10 @@ export class WOTBinding extends AbstractController {
const search = await ParametersService.getSearchP(req);
let identities: any = [];
if (req.query.pubkey) {
const matches = search.match(BMAConstants.PUBLIC_KEY);
if (!matches) {
throw BMAConstants.ERRORS.NO_IDTY_MATCHING_PUB_OR_UID;
}
identities = await this.IdentityService.searchIdentitiesByPubkey(search);
}
else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment