Skip to content

refactor: added options pattern for backend connector init #1592

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 27, 2025

Conversation

kirrg001
Copy link
Contributor

refs #1315

propagateErrorsUpstream = _propagateErrorsUpstream == null ? false : _propagateErrorsUpstream;
defaultTimeout = _defaultTimeout == null ? defaultTimeout : _defaultTimeout;
useLambdaExtension = _useLambdaExtension;
backendTimeout = defaultTimeout;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

68-72 removed because we work with defaults now.

@kirrg001 kirrg001 marked this pull request as ready for review February 26, 2025 14:07
@kirrg001 kirrg001 requested a review from a team as a code owner February 26, 2025 14:07
}
}

if (identityProvider) {
hostHeader = identityProvider.getHostHeader();
if (options.identityProvider) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion:
Can we optimize this to:

if (options.identityProvider) {
    hostHeader = options.identityProvider.getHostHeader() || 'nodejs-serverless';
} else {
    hostHeader = 'nodejs-serverless';
}

Or should we maintain the existing logic to allow hostHeader = '' if getHostHeader() returns an empty string?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. But I have not touched this code. Feel free to raise a new PR to optimize the condition 👍

Copy link
Contributor

@aryamohanan aryamohanan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🫶

@kirrg001 kirrg001 force-pushed the refactor-backend-conn branch from 3f9da78 to 52abf31 Compare February 27, 2025 12:56
@kirrg001 kirrg001 merged commit 5f65e0a into main Feb 27, 2025
1 check passed
@instanacd instanacd deleted the refactor-backend-conn branch May 5, 2025 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants