Skip to content

Commit

Permalink
fix: stack overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kalinkrustev committed May 10, 2024
1 parent a2bbb53 commit 1f2fe56
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 1 addition & 3 deletions src/model/bulkQuotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,11 +439,9 @@ class BulkQuotesModel {
// If JWS is enabled and the 'fspiop-source' matches the configured jws header value('switch')
// that means it's a switch generated message and we need to sign it
if (envConfig.jws && envConfig.jws.jwsSign && opts.headers['fspiop-source'] === envConfig.jws.fspiopSourceToSign) {
const logger = Logger
logger.log = logger.info
this.writeLog('Getting the JWS Signer to sign the switch generated message')
const jwsSigner = new JwsSigner({
logger,
logger: Logger,
signingKey: envConfig.jws.jwsSigningKey
})
opts.headers['fspiop-signature'] = jwsSigner.getSignature(opts)
Expand Down
8 changes: 3 additions & 5 deletions src/model/quotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ class QuotesModel {
// internal-error
// we didnt get an endpoint for the payee dfsp!
// make an error callback to the initiator
throw ErrorHandler.CreateFSPIOPError(ErrorHandler.Enums.FSPIOPErrorCodes.DESTINATION_FSP_ERROR, `No FSPIOP_CALLBACK_URL_QUOTES found for quote ${quoteId} PAYEE party`, null, fspiopSource)
throw ErrorHandler.CreateFSPIOPError(ErrorHandler.Enums.FSPIOPErrorCodes.DESTINATION_FSP_ERROR, `No FSPIOP_CALLBACK_URL_QUOTES found for quote ${quoteId} PAYEE party ${fspiopDest}`, null, fspiopSource)
}

const fullCallbackUrl = `${endpoint}/quotes`
Expand Down Expand Up @@ -568,7 +568,7 @@ class QuotesModel {
if (dupe.isDuplicateId && (!dupe.isResend)) {
// internal-error
// same quoteId but a different request, this is an error!
throw ErrorHandler.CreateFSPIOPError(ErrorHandler.Enums.FSPIOPErrorCodes.MODIFIED_REQUEST, `Update for quote ${quoteUpdateRequest.quoteId} is a duplicate but hashes dont match`, null, fspiopSource)
throw ErrorHandler.CreateFSPIOPError(ErrorHandler.Enums.FSPIOPErrorCodes.MODIFIED_REQUEST, `Update for quote ${quoteId} is a duplicate but hashes don't match`, null, fspiopSource)
}

if (dupe.isResend && dupe.isDuplicateId) {
Expand Down Expand Up @@ -1065,11 +1065,9 @@ class QuotesModel {
opts.headers['fspiop-source'] === envConfig.jws.fspiopSourceToSign

if (needToSign) {
const logger = Logger
logger.log = logger.info
this.writeLog('Getting the JWS Signer to sign the switch generated message')
const jwsSigner = new JwsSigner({
logger,
logger: Logger,
signingKey: envConfig.jws.jwsSigningKey
})
opts.headers['fspiop-signature'] = jwsSigner.getSignature(opts)
Expand Down

0 comments on commit 1f2fe56

Please sign in to comment.