Merge branch 'mikesir87-128-replace-underscores-in-urls'

This commit is contained in:
Marcos Lilljedahl
2017-05-12 16:26:03 -03:00
5 changed files with 8 additions and 8 deletions

View File

@@ -38,7 +38,7 @@ func getTargetInfo(vars map[string]string, req *http.Request) (string, string) {
if strings.HasPrefix(node, "pwd") {
// Node is actually an ip, need to convert underscores by dots.
ip := strings.Replace(strings.TrimPrefix(node, "pwd"), "_", ".", -1)
ip := strings.Replace(strings.TrimPrefix(node, "pwd"), "-", ".", -1)
if net.ParseIP(ip) == nil {
// Not a valid IP, so treat this is a hostname.
@@ -143,7 +143,7 @@ func NewSSLDaemonHandler() http.Handler {
node := v["node"]
if strings.HasPrefix(node, "pwd") {
// Node is actually an ip, need to convert underscores by dots.
ip := strings.Replace(strings.TrimPrefix(node, "pwd"), "_", ".", -1)
ip := strings.Replace(strings.TrimPrefix(node, "pwd"), "-", ".", -1)
if net.ParseIP(ip) == nil {
// Not a valid IP, so treat this is a hostname.