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

[Enhancement] Enhancement getNamesrvAddr trim #7252

Closed
1 task done
shirenchuang opened this issue Aug 25, 2023 · 2 comments
Closed
1 task done

[Enhancement] Enhancement getNamesrvAddr trim #7252

shirenchuang opened this issue Aug 25, 2023 · 2 comments

Comments

@shirenchuang
Copy link
Contributor

Before Creating the Enhancement Request

  • I have confirmed that this should be classified as an enhancement rather than a bug/feature.

Summary

ClientConfig#getNamesrvAddr()

    public String getNamesrvAddr() {
        if (StringUtils.isNotEmpty(namesrvAddr) && NameServerAddressUtils.NAMESRV_ENDPOINT_PATTERN.matcher(namesrvAddr.trim()).matches()) {
            return NameServerAddressUtils.getNameSrvAddrFromNamesrvEndpoint(namesrvAddr);
        }
        return namesrvAddr;
    }

If the format is "http://xxx.xx.xx:9876; " with a space after it, 2 addresses will be parsed out;

  1. xxx.xx.xx:9876
  2. Empty string.

如果格式为"http://xxx.xx.xx:9876; " 后面带有空格的时候,会解析出来2个地址;

  1. xxx.xx.xx:9876
  2. 空串。

解析的时候 可以把nameAddr处理一下

When parsing, you can handle nameAddr

    public String getNamesrvAddr() {
        if (StringUtils.isNotEmpty(namesrvAddr) && NameServerAddressUtils.NAMESRV_ENDPOINT_PATTERN.matcher(namesrvAddr.trim()).matches()) {
            return NameServerAddressUtils.getNameSrvAddrFromNamesrvEndpoint(namesrvAddr.trim());
        }
        return namesrvAddr;
    }

Motivation

.

Describe the Solution You'd Like

.

Describe Alternatives You've Considered

.

Additional Context

No response

Copy link

This issue is stale because it has been open for 365 days with no activity. It will be closed in 3 days if no further activity occurs.

@github-actions github-actions bot added the stale label Aug 25, 2024
Copy link

This issue was closed because it has been inactive for 3 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant