Default fallback_url to use HTTPS

`pypi.python.org/simple` will respond to HTTP requests with `403: SSL is required.`

This will change the default fallback_url to use HTTPS.  This should fix #179.
This commit is contained in:
Jordan Speicher 2017-10-26 11:31:29 -06:00 committed by Jordan Speicher
parent d62d81309b
commit 519c195253
3 changed files with 5 additions and 5 deletions

View File

@ -68,7 +68,7 @@ def configure(**kwds):
"Could not load welcome-file(%s)!", c.welcome_file, exc_info=1)
if c.fallback_url is None:
c.fallback_url = "http://pypi.python.org/simple"
c.fallback_url = "https://pypi.python.org/simple"
if c.hash_algo:
try:

View File

@ -178,7 +178,7 @@ def test_fallback(root, _app, testapp):
assert _app.config.redirect_to_fallback
resp = testapp.get("/simple/pypiserver/", status=302)
assert resp.headers[
"Location"] == "http://pypi.python.org/simple/pypiserver/"
"Location"] == "https://pypi.python.org/simple/pypiserver/"
def test_no_fallback(root, _app, testapp):

View File

@ -80,14 +80,14 @@ def test_root_r(main):
def test_fallback_url(main):
main(["--fallback-url", "http://pypi.mirror/simple"])
assert main.app.module.config.fallback_url == "http://pypi.mirror/simple"
main(["--fallback-url", "https://pypi.mirror/simple"])
assert main.app.module.config.fallback_url == "https://pypi.mirror/simple"
def test_fallback_url_default(main):
main([])
assert main.app.module.config.fallback_url == \
"http://pypi.python.org/simple"
"https://pypi.python.org/simple"
def test_hash_algo_default(main):