Skip to content

Conversation

@gongweibao
Copy link
Collaborator

Fix #512

return nil
}

var re = regexp.MustCompile(`(/|\\)*$`)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Regex is slow, why not simply remove the trailing slash. By the way, can you add a verify of the endpoint string to ensure it is an URL?

Copy link
Collaborator Author

@gongweibao gongweibao Dec 5, 2017

Choose a reason for hiding this comment

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

  1. The user's input is diverse and only a few strings are checked once.
  2. Done!
Copy link
Collaborator

@Yancey0623 Yancey0623 left a comment

Choose a reason for hiding this comment

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

LGTM++

@gongweibao gongweibao merged commit 3b12aac into PaddlePaddle:develop Dec 5, 2017
@gongweibao gongweibao deleted the rmendslash branch December 5, 2017 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants