poeml / mirrorbrain

MirrorBrain
http://mirrorbrain.org/
Other
75 stars 37 forks source link

Support https URLs in baseurl #167

Open rhertzog opened 7 years ago

rhertzog commented 7 years ago

It's a subset of #143 but that should be easy to handle... just allow "https" URLs in the baseurl setting. Everything seems to work fine except "mb test" which fails like this:

Traceback (most recent call last):
  File "/usr/bin/mb", line 1677, in <module>
    r = mirrordoctor.main()
  File "/usr/lib/pymodules/python2.7/cmdln.py", line 257, in main
    return self.cmd(args)
  File "/usr/lib/pymodules/python2.7/cmdln.py", line 280, in cmd
    retval = self.onecmd(argv)
  File "/usr/lib/pymodules/python2.7/cmdln.py", line 412, in onecmd
    return self._dispatch_cmd(handler, argv)
  File "/usr/lib/pymodules/python2.7/cmdln.py", line 1100, in _dispatch_cmd
    return handler(argv[0], opts, *args)
  File "/usr/bin/mb", line 499, in do_test
    r = mb.testmirror.access_http(mirror.identifier, mirror.baseurl)
  File "/usr/lib/pymodules/python2.7/mb/testmirror.py", line 17, in access_http
    S = Sample(identifier, url, '', get_content=True)
  File "/usr/lib/pymodules/python2.7/mb/util.py", line 60, in __init__
    raise Exception('unknown url type: %s' % self.probebaseurl)
Exception: unknown url type: https://archive-2.kali.org/kali-images/

And this is easily fixed in mb/util.py with a simple "or" clause allowing both "http://" and "https://" as prefix for the "http" scheme.