Skip to content

Commit

Permalink
changed _build_url to include ability to parse ipv6 host with bracket…
Browse files Browse the repository at this point in the history
… notation
  • Loading branch information
lawrencellui-dd committed Apr 8, 2016
1 parent 41aa058 commit 39900e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion winrm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def strip_namespace(self, xml):
@staticmethod
def _build_url(target, transport):
match = re.match(
'(?i)^((?P<scheme>http[s]?)://)?(?P<host>[0-9a-z-_.]+)(:(?P<port>\d+))?(?P<path>(/)?(wsman)?)?', target) # NOQA
'(?i)^((?P<scheme>http[s]?)://)?(?P<host>\[([0-9A-Fa-f:]+)]|[0-9a-z-_.]+)(:(?P<port>\d+))?(?P<path>(/)?(wsman)?)?', target) # NOQA
scheme = match.group('scheme')
if not scheme:
# TODO do we have anything other than HTTP/HTTPS
Expand Down

0 comments on commit 39900e2

Please sign in to comment.