Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Commit

Permalink
Fix for resolving dg.712C vs dg.712c BT-24 (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
kshakir authored Nov 9, 2020
1 parent c9030a9 commit 8e3fc7e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion martha/martha_v3.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ function getHttpsUrlParts(url) {
),
httpsUrlSearch: cibMatch.groups.query,
// See `determineDrsType` for more info on this `martha_v2` backwards compatibility
httpsUrlMaybeNotBdc: ![DG_COMPACT_BDC_PROD, DG_COMPACT_BDC_STAGING].includes(cibMatch.groups.host),
httpsUrlMaybeNotBdc:
![DG_COMPACT_BDC_PROD, DG_COMPACT_BDC_STAGING].includes(cibMatch.groups.host.toLowerCase()),
};
}

Expand Down
4 changes: 2 additions & 2 deletions test/martha/martha_v3.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ test.serial('martha_v3 parses BDC staging response correctly', async (t) => {
getJsonFromApiStub.onFirstCall().resolves(bdcDrsResponse);
const response = mockResponse();
await marthaV3(
mockRequest({ body: { 'url': 'drs://dg.712c/fc046e84-6cf9-43a3-99cc-ffa2964b88cb' } }),
mockRequest({ body: { 'url': 'drs://dg.712C/fc046e84-6cf9-43a3-99cc-ffa2964b88cb' } }),
response,
);
const result = response.send.lastCall.args[0];
Expand All @@ -514,7 +514,7 @@ test.serial('martha_v3 parses BDC staging response correctly', async (t) => {
t.is(
getJsonFromApiStub.firstCall.args[0],
'https://staging.gen3.biodatacatalyst.nhlbi.nih.gov/ga4gh/dos/v1/dataobjects' +
'/dg.712c/fc046e84-6cf9-43a3-99cc-ffa2964b88cb',
'/dg.712C/fc046e84-6cf9-43a3-99cc-ffa2964b88cb',
);
t.falsy(getJsonFromApiStub.firstCall.args[1]); // no auth passed
const requestedBondUrl = getJsonFromApiStub.secondCall.args[0];
Expand Down

0 comments on commit 8e3fc7e

Please sign in to comment.