Skip to content

Use guard hostname for realtime and config polling - #448

Open
hansott wants to merge 1 commit into
mainfrom
realtime
Open

Use guard hostname for realtime and config polling#448
hansott wants to merge 1 commit into
mainfrom
realtime

Conversation

@hansott

@hansott hansott commented Aug 17, 2026

Copy link
Copy Markdown
Member

No description provided.

return GetGuardEndpoint(completeEnvGetters, token);
}

std::string GetRealtimeEndpoint(const std::vector<EnvGetterFn>& envGetters, const std::string& token) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

GetRealtimeEndpoint duplicates GetGuardEndpoint's endpoint-resolution logic. Consolidate the shared logic into one helper parameterized by the environment-variable name.

Details

✨ AI Reasoning
​The added function follows the same sequence as the existing endpoint resolver: read an environment variable, return it when configured, and otherwise derive a regional endpoint from the token. A change to endpoint selection would otherwise need to be kept consistent in both functions. Extract the shared resolution logic and pass the environment-variable name as an argument.

🔧 How do I fix it?
Delete extra code. Extract repeated code sequences into reusable functions or methods. Use loops or data structures to eliminate repetitive patterns.

Reply @AikidoSec feedback: [FEEDBACK] to get better review comments in the future.
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info

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.

1 participant