Skip to content

Commit

Permalink
new split of host value
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Nov 18, 2016
1 parent d41c964 commit 5d57334
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/netius/extra/proxy_r.py
Expand Up @@ -126,7 +126,7 @@ def on_headers(self, connection, parser):
version_s = parser.version_s
is_secure = connection.ssl
host = headers.get("host", None)
host_s = host.split(":", 1)[0] if host else host
host_s = host.rsplit(":", 1)[0] if host else host
host = self.alias.get(host_s, host)
host = self.alias.get(host, host)

Expand Down Expand Up @@ -202,7 +202,7 @@ def on_headers(self, connection, parser):

# verifies if the current host requires come kind of special authorization
# process using the default basic http authorization process
auth = self.auth.get(host.split(":", 1)[0], None)
auth = self.auth.get(host.rsplit(":", 1)[0], None)
auth, _match = self._resolve_regex(url, self.auth_regex, default = auth)
if auth:
# determines if the provided authentication method is a sequence
Expand Down Expand Up @@ -359,7 +359,7 @@ def rules_host(self, url, parser):
# is then used to "resolve" the final prefix value from sequence
host = headers.get("host", None)
host = self.alias.get(host, host)
host_s = host.split(":", 1)[0] if host else host
host_s = host.rsplit(":", 1)[0] if host else host
prefix = self.hosts.get(host_s, None)
prefix = self.hosts.get(host, prefix)
resolved = self.balancer(prefix)
Expand Down

0 comments on commit 5d57334

Please sign in to comment.