Replaced all uses of underscore in proxy URLs with dashes

Issue #128
This commit is contained in:
Michael Irwin
2017-04-26 00:10:35 -04:00
parent 6acb6f47c5
commit e31dc8cfaa
3 changed files with 17 additions and 10 deletions

View File

@@ -27,7 +27,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.
@@ -132,7 +132,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.