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

[SCB-591] configcenter need to do encode #713

Merged
merged 4 commits into from May 21, 2018
Merged

[SCB-591] configcenter need to do encode #713

merged 4 commits into from May 21, 2018

Conversation

weichao666
Copy link
Contributor

@weichao666 weichao666 commented May 17, 2018

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a JIRA issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [SCB-XXX] Fixes bug in ApproximateQuantiles, where you replace SCB-XXX with the appropriate JIRA issue.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean install to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

huawei's huangyun set up an agent to modify the special characters '#',which led to the governance inoperative

try {
encodeServiceName = URLEncoder.encode(serviceName, "UTF-8");
} catch (UnsupportedEncodingException e1) {
e1.printStackTrace();
Copy link
Contributor

Choose a reason for hiding this comment

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

print?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

} catch (UnsupportedEncodingException e1) {
e1.printStackTrace();
}
String path = URIConst.ITEMS + "?dimensionsInfo=" + StringUtils.deleteWhitespace(encodeServiceName);
Copy link
Contributor

Choose a reason for hiding this comment

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

delete whitespace before or after encode?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@coveralls
Copy link

coveralls commented May 17, 2018

Coverage Status

Coverage increased (+0.2%) to 87.566% when pulling ee0a340 on weichao666:configencoding into 61cda00 on apache:master.

try {
encodeServiceName = URLEncoder.encode(StringUtils.deleteWhitespace(serviceName), "UTF-8");
} catch (UnsupportedEncodingException e) {
LOGGER.error("encode error: {}",e.getMessage());
Copy link
Contributor

Choose a reason for hiding this comment

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

1.not format code
2.failed but still continue?
3."UTF-8" can changed to java.nio.charset.StandardCharsets.UTF_8.name()

Copy link
Contributor

Choose a reason for hiding this comment

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

we can encoding serviceName in instance initialization if possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ServiceName is stitched together in the CONFIG_CENTER_CONFIG.getServiceName() method,so you mean do encode in this method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

format code,failed,UTF_8.name() have done.

@liubao68 liubao68 merged commit 5fc99f5 into apache:master May 21, 2018
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.

None yet

4 participants