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

build ClientInfo with empty user-agent throws java.lang.StringIndexOutOfBoundsException #4987

Closed
pixystone opened this issue Mar 2, 2021 · 1 comment
Assignees
Labels
kind/bug Category issues or prs related to bug. version/2.x
Milestone

Comments

@pixystone
Copy link
Contributor

Describe the bug

Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1919)
at com.alibaba.nacos.naming.push.v1.ClientInfo.(ClientInfo.java:41)
at com.alibaba.nacos.naming.core.InstanceOperatorServiceImpl.listInstance(InstanceOperatorServiceImpl.java:146)

Expected behavior

return a ClientInfo with an unknown version by default

Acutally behavior

throws an exception

How to Reproduce

new ClientInfo("")

Desktop (please complete the following information):

  • OS: [osx]
  • Version [nacos-server 2.0.0-BETA]
  • Module [naming]
  • SDK [original]

Additional context

@KomachiSion KomachiSion added the kind/bug Category issues or prs related to bug. label Mar 2, 2021
@KomachiSion KomachiSion modified the milestones: 1.4.2, 2.0.0 Mar 2, 2021
@KomachiSion KomachiSion self-assigned this Mar 2, 2021
@pixystone
Copy link
Contributor Author

ClientType.getType() the same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Category issues or prs related to bug. version/2.x
Projects
None yet
Development

No branches or pull requests

2 participants