@@ -5,6 +5,7 @@ import (
"net"
"ngrok/conn"
"ngrok/log"
+ "strings"
)
const (
@@ -68,7 +69,7 @@ func httpHandler(tcpConn net.Conn) {
}
// read out the Host header from the request
- host := req.Host
+ host := strings.ToLower(req.Host)
conn.Debug("Found hostname %s in request", host)
// multiplex to find the right backend host
@@ -124,6 +124,9 @@ func newTunnel(m *msg.RegMsg, ctl *Control) (t *Tunnel) {
t.url = fmt.Sprintf("http://%s.%s", t.regMsg.Subdomain, vhost)
+ vhost = strings.ToLower(vhost)
+ t.url = strings.ToLower(t.url)
+
if t.url != "" {
if err := tunnels.Register(t.url, t); err != nil {
failReg(err)