Skip to content

Commit

Permalink
feat(Revocation): [#715] encodeURI assertionId
Browse files Browse the repository at this point in the history
  • Loading branch information
raiseandfall committed Sep 5, 2020
1 parent 73afc13 commit fb7c24e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/domain/verifier/useCases/getRevokedAssertions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default async function getRevokedAssertions (revocationListUrl: string, a
const errorMessage: string = getText('errors', 'getRevokedAssertions');

if (assertionId) {
revocationListUrl = safelyAppendUrlParameter(revocationListUrl, ASSERTION_ID_NAME, assertionId);
revocationListUrl = safelyAppendUrlParameter(revocationListUrl, ASSERTION_ID_NAME, encodeURIComponent(assertionId));
}

const response: any = await request({ url: revocationListUrl }).catch(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ describe('Verifier domain getRevokedAssertions use case test suite', function ()
describe('and an assertionId', function () {
it('should request the correct URL with the appended assertionId', async function () {
stubRequest.resolves(revokedAssertionsAssertionString);
const fixtureAssertionId = 'fixture-assertion-id';
const fixtureAssertionId = 'https://fixture-assertion-id.domain.tld';
await getRevokedAssertions(issuerIdFixture, fixtureAssertionId);
expect(stubRequest.getCall(0).args[0]).toEqual({
url: 'http://domain.tld/path?assertionId=fixture-assertion-id'
url: 'http://domain.tld/path?assertionId=https%3A%2F%2Ffixture-assertion-id.domain.tld'
});
});
});
Expand Down

0 comments on commit fb7c24e

Please sign in to comment.