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

Remove a trailing slash from the base URL to the ws agent REST services #1237

Merged
merged 2 commits into from
May 12, 2016

Conversation

vparfonov
Copy link
Contributor

Signed-off-by: Vitaly Parfonov vparfonov@codenvy.com
@garagatyi

Signed-off-by: Vitaly Parfonov <vparfonov@codenvy.com>
public String getWsAgentBaseUrl() {
DevMachineServer server = getServer(Constants.WSAGENT_REFERENCE);
if (server != null) {
return server.getUrl();
return server.getUrl().replaceAll("/$", ""); //here we remove trailing slash if exist

Choose a reason for hiding this comment

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

I think that you can improve speed and clarity of this operation with

String url = server.getUrl();
if (url.endsWith("/")) {
    url = url.substring(0, url.length() - 1);
}
return url;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

Signed-off-by: Vitaly Parfonov <vparfonov@codenvy.com>
@vparfonov vparfonov merged commit 33c46d4 into master May 12, 2016
@vparfonov vparfonov deleted the removeTrailingSlashWsAgentUrl branch May 12, 2016 12:02
@codenvy-ci
Copy link

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.

3 participants