Skip to content
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

Fixed check for TCP protocol #3163

Merged
merged 1 commit into from
Apr 14, 2021
Merged

Fixed check for TCP protocol #3163

merged 1 commit into from
Apr 14, 2021

Conversation

sortiz1191
Copy link
Contributor

Hi team!
This PR checks the new protocol format from API response
Closes #3154

@sortiz1191 sortiz1191 requested a review from a team April 14, 2021 17:02
@sortiz1191 sortiz1191 self-assigned this Apr 14, 2021
@@ -206,7 +206,7 @@ export class RegisterAgent extends Component {
{}
);
const remote = ((result.data || {}).data || {}).remote || {};
return (remote[0] || {}).protocol !== 'tcp';
return (remote[0] || {}).protocol !== 'tcp' && (remote[0] || {}).protocol[0] !== 'TCP';
Copy link
Contributor

@frankeros frankeros Apr 14, 2021

Choose a reason for hiding this comment

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

it could be improved with upper case and checking is an array

const protocol = Array.isArray((remote[0] || {}).protocol) ?  remote[0].protocol[0] : (remote[0] || {}).protocol || '';
return protocol.toUpperCase() !== 'TCP';

@frankeros
Copy link
Contributor

tested ✔️
LGTM!

@frankeros frankeros merged commit 0e6fb22 into 4.2-7.10 Apr 14, 2021
@frankeros frankeros deleted the fix/add_agent_protocol branch April 14, 2021 20:05
@frankeros frankeros changed the title added TCP protocol and check TCP protocol Fixed check for TCP protocol Apr 14, 2021
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.

2 participants