Browse Source

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

tests
Sebastian Lohff 9 years ago
parent
commit
320839d856
  1. 6
      ChangeLog
  2. 5
      servefile

6
ChangeLog

@ -1,6 +1,12 @@ @@ -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
-----------------

5
servefile

@ -869,10 +869,13 @@ class ServeFile(): @@ -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:

Loading…
Cancel
Save