external-adapters-js
external-adapters-js copied to clipboard
There is a logic missing in adapter cfbenchmarks's endpoint/crypto-lwba.ts.
Description
There is a logic missing in adapter cfbenchmarks's crypto-lwba.ts. When I set API_SECONDARY=false,
the code here has no way to generate a proper index to req.requestContext.data.index
.
I apologize if my issue may potentially cause inconvenience, as I am not entirely certain if it is the exact problem. Thanks.
export const lwbaReqTransformer = (req: AdapterRequest<typeof inputParameters.validated>): void => {
additionalInputValidation(req.requestContext.data)
if (!req.requestContext.data.index) {
req.requestContext.data.index = getSecondaryId(
req.requestContext.data.base as string,
req.requestContext.data.quote as string,
)
}
// Clear base quote to ensure an exact match in the cache with index
delete req.requestContext.data.base
delete req.requestContext.data.quote
}