Display user/password in url-list when authentication is used

This commit is contained in:
Sebastian Lohff 2013-10-01 14:09:58 +02:00
parent 80c9d9fe0a
commit 320839d856
2 changed files with 10 additions and 1 deletions

View File

@ -1,6 +1,12 @@
servefile changelog
===================
v0.4.3
------
* display user/password in url-list when authentication is used
2012-06-27 v0.4.2
-----------------

View File

@ -869,10 +869,13 @@ class ServeFile():
if not ips or len(ips) == 0 or ips[0] == '':
print("Could not find any addresses.")
else:
pwPart = ""
if self.auth:
pwPart = base64.b64decode(self.auth) + "@"
for ip in ips:
if ":" in ip:
ip = "[%s]" % ip
print("\thttp%s://%s:%d/" % (self.useSSL and "s" or "", ip, self.port))
print("\thttp%s://%s%s:%d/" % (self.useSSL and "s" or "", pwPart, ip, self.port))
print()
try: