diff options
author | Matthew Miller <matthew@millerti.me> | 2020-07-04 14:16:42 -0700 |
---|---|---|
committer | Matthew Miller <matthew@millerti.me> | 2020-07-04 14:16:42 -0700 |
commit | 17c54060ef8ee08c383e793783d2216e388e7abd (patch) | |
tree | 0a4fd6e1b7cdcabbba4f0e175d329c7dff91ecfe | |
parent | 3b9eb08c6a0517820009b4ec0a24bb585f7632af (diff) |
Update getStatement to allow for aaguid Buffers
-rw-r--r-- | packages/server/src/metadata/metadataService.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/server/src/metadata/metadataService.ts b/packages/server/src/metadata/metadataService.ts index b9be929..c44c275 100644 --- a/packages/server/src/metadata/metadataService.ts +++ b/packages/server/src/metadata/metadataService.ts @@ -6,6 +6,7 @@ import { ENV_VARS } from '../helpers/constants'; import toHash from '../helpers/toHash'; import validateCertificatePath from '../helpers/validateCertificatePath'; import convertASN1toPEM from '../helpers/convertASN1toPEM'; +import convertAAGUIDToString from '../helpers/convertAAGUIDToString'; import parseJWT from './parseJWT'; @@ -53,11 +54,15 @@ class MetadataService { * If `process.env.ENABLE_MDS` is `'true'`, then this method will coordinate re-downloading data * as per the `nextUpdate` property in the initial TOC download. */ - async getStatement(aaguid: string): Promise<MetadataStatement | undefined> { + async getStatement(aaguid: string | Buffer): Promise<MetadataStatement | undefined> { if (!aaguid) { return; } + if (aaguid instanceof Buffer) { + aaguid = convertAAGUIDToString(aaguid); + } + if (ENABLE_MDS) { const now = new Date(); if (now > this.nextUpdate) { |