-
Notifications
You must be signed in to change notification settings - Fork 37
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
Conversation
propagateErrorsUpstream = _propagateErrorsUpstream == null ? false : _propagateErrorsUpstream; | ||
defaultTimeout = _defaultTimeout == null ? defaultTimeout : _defaultTimeout; | ||
useLambdaExtension = _useLambdaExtension; | ||
backendTimeout = defaultTimeout; |
There was a problem hiding this comment.
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.
} | ||
} | ||
|
||
if (identityProvider) { | ||
hostHeader = identityProvider.getHostHeader(); | ||
if (options.identityProvider) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🫶
3f9da78
to
52abf31
Compare
refs #1315