Skip to content

fix: only accept hostname from args only if it's not whitespace#8

Open
Cucumberrbob wants to merge 1 commit intorogerfar:mainfrom
Cucumberrbob:fix/empty-string-api-hostname
Open

fix: only accept hostname from args only if it's not whitespace#8
Cucumberrbob wants to merge 1 commit intorogerfar:mainfrom
Cucumberrbob:fix/empty-string-api-hostname

Conversation

@Cucumberrbob
Copy link
Contributor

@Cucumberrbob Cucumberrbob commented Jun 19, 2025

User description

related rogerfar/rdt-client#847 (comment)


PR Type

Bug fix


Description

• Fix hostname validation to reject empty/whitespace strings
• Prevent setting invalid API hostname from constructor arguments


Changes walkthrough 📝

Relevant files
Bug fix
RdNetClient.cs
Improve hostname parameter validation                                       

RDNET/RdNetClient.cs

• Changed null check to String.IsNullOrWhiteSpace() for apiHostname
parameter
• Prevents setting empty or whitespace-only hostnames in
constructor

+1/-1     

Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • @qodo-code-review
    Copy link

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Logic Issue

    The condition change may alter existing behavior. Previously, an empty string would be set as the hostname, now it won't be. This could break existing code that relies on empty string being a valid hostname value.

    if (!String.IsNullOrWhiteSpace(apiHostname))
    {
        _store.ApiHostname = apiHostname;
    }

    @qodo-code-review
    Copy link

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    1 participant