diff --git a/app/modules/bma/lib/controllers/wot.ts b/app/modules/bma/lib/controllers/wot.ts index 43c6e1e97f006480472a160e4ec5bf9dc97ed482..d408c3a6194e8360a6099249d517a41f8c153222 100644 --- a/app/modules/bma/lib/controllers/wot.ts +++ b/app/modules/bma/lib/controllers/wot.ts @@ -188,7 +188,7 @@ export class WOTBinding extends AbstractController { async requirements(req: any): Promise<HttpRequirements> { const search = await ParametersService.getSearchP(req); let identities: any = []; - if (req.query?.pubkey === true || req.query?.pubkey === "true") { + if (req.query.pubkey) { identities = await this.IdentityService.searchIdentitiesByPubkey(search); } else { diff --git a/test/integration/identity/identity-test.ts b/test/integration/identity/identity-test.ts index 708ba15f22dbef1bae5bb777a9e97656badd8a69..2a60a7ffb6f58ba0fcf6c4a4eef072101ec022a7 100644 --- a/test/integration/identity/identity-test.ts +++ b/test/integration/identity/identity-test.ts @@ -292,7 +292,7 @@ describe("Identities collision", function() { }); it('requirements by pubkey of cat', function() { - return expectAnswer(rp('http://127.0.0.1:7799/wot/requirements/HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd?pubkey=true', { json: true }), function(res:HttpRequirements) { + return expectAnswer(rp('http://127.0.0.1:7799/wot/requirements/HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd?pubkey', { json: true }), function(res:HttpRequirements) { res.should.have.property('identities').be.an.Array; res.should.have.property('identities').have.length(1); res.identities[0].should.have.property('pubkey').equal('HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd'); @@ -309,7 +309,7 @@ describe("Identities collision", function() { }); it('requirements by pubkey of man1', function() { - return expectAnswer(rp('http://127.0.0.1:7799/wot/requirements/12AbjvYY5hxV4v2KrN9pnGzgFxogwrzgYyncYHHsyFDK?pubkey=true', { json: true }), function(res:HttpRequirements) { + return expectAnswer(rp('http://127.0.0.1:7799/wot/requirements/12AbjvYY5hxV4v2KrN9pnGzgFxogwrzgYyncYHHsyFDK?pubkey', { json: true }), function(res:HttpRequirements) { res.should.have.property('identities').be.an.Array; res.should.have.property('identities').have.length(1); res.identities[0].should.have.property('pubkey').equal('12AbjvYY5hxV4v2KrN9pnGzgFxogwrzgYyncYHHsyFDK'); @@ -328,7 +328,7 @@ describe("Identities collision", function() { }); it('requirements by invalid pubkey', function() { - return expectError(404, "No identity matching this pubkey or uid", rp('http://127.0.0.1:7799/wot/requirements/cat?pubkey=true', { json: true })); + return expectError(404, "No identity matching this pubkey or uid", rp('http://127.0.0.1:7799/wot/requirements/cat?pubkey', { json: true })); }); it('should have certified-by/tic giving results', function() {